Relax assert in ResolveTokenInScope (#38542)

`ResolveTokenInScope` now gets called with `typeOrMethodContext` that is a non-generic method. Make sure the method is on the same type.
This commit is contained in:
Michal Strehovský authored and GitHub committed 2020-06-29 20:44:53 +02:00
1 parent 826b6f0a94
commit d58e5bbcdf
1 file changed
+3 -1
@@ -1010,8 +1010,10 @@ namespace Internal.JitInterface
else
{
var methodContext = (MethodDesc)typeOrMethodContext;
Debug.Assert(methodContext.GetTypicalMethodDefinition() == owningMethod.GetTypicalMethodDefinition() ||
Debug.Assert((!methodContext.HasInstantiation && !owningMethod.HasInstantiation) ||
methodContext.GetTypicalMethodDefinition() == owningMethod.GetTypicalMethodDefinition() ||
(owningMethod.Name == "CreateDefaultInstance" && methodContext.Name == "CreateInstance"));
Debug.Assert(methodContext.OwningType.HasSameTypeDefinition(owningMethod.OwningType));
typeInst = methodContext.OwningType.Instantiation;
methodInst = methodContext.Instantiation;
}