Skip to content

Commit

Permalink
Fixed #307
Browse files Browse the repository at this point in the history
  • Loading branch information
liiir1985 committed Apr 1, 2020
1 parent b85a853 commit da15012
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ILRuntime/Runtime/Enviorment/AppDomain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,11 @@ internal IType GetType(object token, IType contextType, IMethod contextMethod)
{
t = ((ILMethod)contextMethod).FindGenericArgument(_ref.Name);
}
if (t != null)
{
mapTypeToken[t.GetHashCode()] = t;
mapType[t.FullName] = t;
}
return t;
}
if (_ref.IsByReference)
Expand Down
10 changes: 10 additions & 0 deletions TestCases/GenericMethodTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -507,5 +507,15 @@ public static void GenericStaticMethodTest12()
{
ILRuntimeTest.TestBase.StaticGenericMethods.Method("");
}

public static void GenericStaticMethodTest13()
{
GenericStaticMethodTest13Sub<int[]>();
}
static void GenericStaticMethodTest13Sub<T>()
{
var t = typeof(T);//出错
Console.WriteLine(t);
}
}
}

0 comments on commit da15012

Please sign in to comment.