Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public EETypeNode(NodeFactory factory, TypeDesc type)
else if (type.IsCanonicalSubtype(CanonicalFormKind.Any))
Debug.Assert((this is CanonicalEETypeNode) || (this is NecessaryCanonicalEETypeNode));

Debug.Assert(!type.IsGenericParameter);
Debug.Assert(!type.IsRuntimeDeterminedSubtype);
_type = type;
_optionalFieldsNode = new EETypeOptionalFieldsNode(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ internal sealed class NativeLayoutMethodLdTokenVertexNode : NativeLayoutMethodEn
protected override string GetName(NodeFactory factory) => "NativeLayoutMethodLdTokenVertexNode_" + factory.NameMangler.GetMangledMethodName(_method);

public NativeLayoutMethodLdTokenVertexNode(NodeFactory factory, MethodDesc method)
: base(factory, method, 0)
: base(factory, method, method.IsRuntimeDeterminedExactMethod || method.IsGenericMethodDefinition ? 0 : MethodEntryFlags.CreateInstantiatedSignature)
{
}

Expand Down
26 changes: 26 additions & 0 deletions src/tests/nativeaot/SmokeTests/UnitTests/Generics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ internal static int Run()
Test99198Regression.Run();
Test102259Regression.Run();
Test104913Regression.Run();
Test105397Regression.Run();
TestInvokeMemberCornerCaseInGenerics.Run();
TestRefAny.Run();
TestNullableCasting.Run();
Expand Down Expand Up @@ -3629,6 +3630,31 @@ public static void Run()
}
}

class Test105397Regression
{
interface IEnumerable<T> { }

interface ITest<TResult>
{
TReturn UsingDatabaseResult<TState, TReturn>(TState state, Func<TResult, TState, TReturn> @using);
}
class Test<TResult> : ITest<TResult>
{
public TReturn UsingDatabaseResult<TState, TReturn>(TState state, Func<TResult, TState, TReturn> @using)
{
return default;
}
}

struct GenStruct<T> { }

public static void Run()
{
ITest<object> t = new Test<object>();
t.UsingDatabaseResult<IEnumerable<IEnumerable<GenStruct<double>>>, int>(null, (x, y) => 1);
}
}

class TestInvokeMemberCornerCaseInGenerics
{
class Generic<T>
Expand Down