Skip to content

Commit 47c0acf

Browse files
committed
Add warning validation
1 parent 89a776f commit 47c0acf

File tree

1 file changed

+10
-1
lines changed
  • src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection

1 file changed

+10
-1
lines changed

src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/TypeMap.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ namespace Mono.Linker.Tests.Cases.Reflection
2424
class TypeMap
2525
{
2626
[Kept]
27-
public static void Main(string[] args)
27+
[ExpectedWarning ("IL2057", "Unrecognized value passed to the parameter 'typeName' of method 'System.Type.GetType(String)'")]
28+
public static void Main (string[] args)
2829
{
2930
object t = Activator.CreateInstance (Type.GetType (args[1]));
3031
if (t is TargetAndTrimTarget) {
@@ -37,6 +38,14 @@ public static void Main(string[] args)
3738

3839
Console.WriteLine (TypeMapping.GetOrCreateExternalTypeMapping<UsedTypeMap> ());
3940
Console.WriteLine (TypeMapping.GetOrCreateProxyTypeMapping<UsedTypeMap> ());
41+
Console.WriteLine (GetExternalTypeMap<UnusedTypeMap> ());
42+
}
43+
44+
[Kept]
45+
[ExpectedWarning ("IL2124", "Type 'T' must not contain signature variables to be used as a type map group.")]
46+
private static IReadOnlyDictionary<string, Type> GetExternalTypeMap<T> ()
47+
{
48+
return TypeMapping.GetOrCreateExternalTypeMapping<T> ();
4049
}
4150
}
4251

0 commit comments

Comments
 (0)