Skip to content

Commit

Permalink
XXX - revert me - hack up FullyGeneralGenerics test
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdageek committed Oct 15, 2021
1 parent 90e9ace commit 2da6a44
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static int Main()
fullyGenericType.GetMethod("UseValue").Invoke(null, null);
fullyGenericType.GetMethod("FailOnNonStandardTypeWithException").Invoke(null, null);

#if false
Console.WriteLine("Test Can Create Generic of ByRef");
fullyGenericType = typeof(GenericType<>).MakeGenericType(typeof(int).MakeByRefType());
Console.WriteLine(fullyGenericType.FullName);
Expand All @@ -65,30 +66,34 @@ static int Main()
Console.WriteLine("FAILED to throw exception calling method with [GenericParameterSupportsOnlyNonByRefLikeAttribute]");
return 1;
} catch {}

#endif
Console.WriteLine("Test Can Create Generic of ByRef to ByRef");
fullyGenericType = typeof(GenericType<>).MakeGenericType(typeof(int).MakeByRefType().MakeByRefType());
Console.WriteLine(fullyGenericType.FullName);
fullyGenericType.GetMethod("UseValue").Invoke(null, null);
#if false
try
{
fullyGenericType.GetMethod("FailOnNonStandardTypeWithException").Invoke(null, null);
Console.WriteLine("FAILED to throw exception calling method with [GenericParameterSupportsOnlyNonByRefLikeAttribute]");
return 1;
} catch {}
#endif

Console.WriteLine("Test Can Create Generic of TypedReference");
fullyGenericType = typeof(GenericType<>).MakeGenericType(typeof(TypedReference));
Console.WriteLine(fullyGenericType.FullName);
fullyGenericType.GetMethod("UseValue").Invoke(null, null);
#if false
try
{
fullyGenericType.GetMethod("FailOnNonStandardTypeWithException").Invoke(null, null);
Console.WriteLine("FAILED to throw exception calling method with [GenericParameterSupportsOnlyNonByRefLikeAttribute]");
return 1;
} catch {}
#endif

return 100;
}
}
}
}

0 comments on commit 2da6a44

Please sign in to comment.