Skip to content

Commit

Permalink
Fix validation of uninstantiated generic methods (dotnet#2137)
Browse files Browse the repository at this point in the history
Matches what we do for uninstatiated generic types - no need to look at generic parameters.
  • Loading branch information
MichalStrehovsky authored Jan 24, 2020
1 parent cb1fc80 commit e786610
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ public void EnsureLoadableMethod(MethodDesc method)
{
EnsureLoadableType(method.OwningType);

if (method.HasInstantiation)
// If this is an instantiated generic method, check the instantiation.
MethodDesc methodDef = method.GetMethodDefinition();
if (methodDef != method)
{
foreach (var instType in method.Instantiation)
EnsureLoadableType(instType);
Expand Down Expand Up @@ -102,12 +104,6 @@ private static TypeDesc EnsureLoadableTypeUncached(TypeDesc type)
{
ThrowHelper.ThrowTypeLoadException(ExceptionStringID.ClassLoadGeneral, type);
}
#if READYTORUN
else if (type.IsGenericParameter)
{
return type;
}
#endif
else
{
// Validate classes, structs, enums, interfaces, and delegates
Expand Down

0 comments on commit e786610

Please sign in to comment.