Skip to content
Merged
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
32 changes: 32 additions & 0 deletions src/tests/nativeaot/SmokeTests/UnitTests/Interfaces.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public static int Run()
TestSharedInterfaceMethods.Run();
TestGenericAnalysis.Run();
TestRuntime108229Regression.Run();
TestRuntime109893Regression.Run();
TestCovariantReturns.Run();
TestDynamicInterfaceCastable.Run();
TestStaticInterfaceMethodsAnalysis.Run();
Expand Down Expand Up @@ -872,6 +873,37 @@ public static void Run()
}
}

class TestRuntime109893Regression
{
class Type<T> : IType<T>;

class MyVisitor : IVisitor
{
public object? Visit<T>(IType<T> _) => typeof(T);
}

interface IType
{
object? Accept(IVisitor visitor);
}

interface IType<T> : IType
{
object? IType.Accept(IVisitor visitor) => visitor.Visit(this);
}

interface IVisitor
{
object? Visit<T>(IType<T> type);
}

public static void Run()
{
IType type = new Type<object>();
type.Accept(new MyVisitor());
}
}

class TestCovariantReturns
{
interface IFoo
Expand Down