[Mono-bugs] [Bug 507473] New: Generic type variance problems

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed May 27 10:17:06 EDT 2009


User msafar at novell.com added comment

           Summary: Generic type variance problems
    Classification: Mono
           Product: Mono: Runtime
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: JIT
        AssignedTo: lupus at novell.com
        ReportedBy: msafar at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

All samples have to be compiled using gmcs -langversion:future

Test #1

interface IFoo<in T>
    string Bar (T t);

class Foo : IFoo<object>
    public string Bar (object t)
        return t.GetType ().FullName;

public class Test
    static int Main ()
        IFoo<object> foo = new Foo ();
        IFoo<string> foo2 = foo;

        if (foo2.Bar ("blah") != typeof (string).FullName)
            return 1;

        foo2 = new Foo();
        if (foo2.Bar ("blah") != typeof (string).FullName)
            return 2;

        return 0;

mono 1.exe 
Foo doesn't implement interface IFoo<System.String>
ERROR:mini-trampolines.c:116:mono_convert_imt_slot_to_vtable_slot: code should
not be reached

  at Test.Main () <0xffffffff>
  at Test.Main () <0x0002c>
  at (wrapper runtime-invoke) Test.runtime_invoke_int
(object,intptr,intptr,intptr) <0xffffffff>

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list