Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitek Karas <10670590+vitek-karas@users.noreply.github.com>2022-06-14 00:19:48 +0300
committerGitHub <noreply@github.com>2022-06-14 00:19:48 +0300
commit27b9dd6bf92ddab04763ebaec931f83dad62cfa1 (patch)
treeb1e589b8b23585c401cfe5267d891465a22117eb /test/Mono.Linker.Tests.Cases/DataFlow
parentbac3887b94433c5c99f3002afc3de5e191d3226e (diff)
Mark all type forwarders used during string->Type resolution (#2836)
Previously we only marked the type forwarder for the outer-most type (if any), but the same problem can happen with type names in generic arguments. If they are forwarder we need to mark those type forwarders as well. This change records all type resolutions during the string->Type resolution and then makes sure that all type forwarders used get marked. Renamed a method on HandleCallAction to make it more descriptive of what it actually does. Also unifies all string->Type resolution into the ReflectionMarker. Enabled test which has been already added for the bug and added another variation (CreateInstance). Improved ResultsChecker to include assembly names in validation messages.
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/DataFlow')
-rw-r--r--test/Mono.Linker.Tests.Cases/DataFlow/ComplexTypeHandling.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/ComplexTypeHandling.cs b/test/Mono.Linker.Tests.Cases/DataFlow/ComplexTypeHandling.cs
index 18c77aa81..2e071edd7 100644
--- a/test/Mono.Linker.Tests.Cases/DataFlow/ComplexTypeHandling.cs
+++ b/test/Mono.Linker.Tests.Cases/DataFlow/ComplexTypeHandling.cs
@@ -139,7 +139,11 @@ namespace Mono.Linker.Tests.Cases.DataFlow
RequirePublicMethods (Type.GetType ("Mono.Linker.Tests.Cases.DataFlow.ComplexTypeHandling+ArrayTypeGetTypeElement[]"));
}
- // Nothing should be marked as CreateInstance doesn't work on arrays
+ // Technically there's no reason to mark this type since it's only used as an array element type and CreateInstance
+ // doesn't work on arrays, but the currently implementation will preserve it anyway due to how it processes
+ // string -> Type resolution. This will only impact code which would have failed at runtime, so very unlikely to
+ // actually occur in real apps (and even if it does happen, it just increases size, doesn't break behavior).
+ [Kept]
class ArrayCreateInstanceByNameElement
{
public ArrayCreateInstanceByNameElement ()