Skip to content

Commit

Permalink
Add regression test for mono#10837.
Browse files Browse the repository at this point in the history
  • Loading branch information
kumpera committed Nov 5, 2018
1 parent 7b5b1e2 commit 24d1f2d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions mono/tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ TESTS_CS_SRC= \
verbose.cs \
generic-unmanaged-constraint.cs \
bug-10834.cs \
bug-10837.cs \
bug-gh-9507.cs

# some tests fail to compile on mcs
Expand Down
44 changes: 44 additions & 0 deletions mono/tests/bug-10837.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
Packed interface table for class Repro.Derived
*/
using System;

namespace Repro {
interface Interface<T0>
{
void Problem();
}
class Base<T1> : Interface<T1>
{
void Interface<T1>.Problem() {
Console.WriteLine("Base.Method()");
throw new Exception ();
}
}
class Derived<U> : Base<int>, Interface<U>
{
void Interface<U>.Problem() { Console.WriteLine("Derived`2.Method()"); }
~Derived() {

}
}
class FinalClass : Derived<int>, Interface<string>, Interface<int>
{
void Interface<string>.Problem() {
Console.WriteLine("Derived.Method()");
throw new Exception ();
}
}
class Program
{
public static void Main()
{
Interface<int> j = new FinalClass();
j.Problem();
}
}
}

0 comments on commit 24d1f2d

Please sign in to comment.