[Mono-bugs] [Bug 479776] New: gmcs generates bad image for generic type nested from another generic type

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Feb 25 23:58:58 EST 2009


           Summary: gmcs generates bad image for generic type nested from
                    another generic type
    Classification: Mono
           Product: Mono: Compilers
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: atsushi at ximian.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:
Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)

The repro code shows a nested generic class inside another generic class, which
results in runtime error on both .NET and Mono runtimes.

Probably typeof expression emits bad image.

Reproducible: Always

Steps to Reproduce:
Compile and run the repro with gmcs. To compare the difference, you might want
to try csc.

using System;

class C : C1<string>
    public static void Main ()
        Console.WriteLine (t);

class C1<T>
    class C2<U> {}

    public static Type t =
        typeof (C2<>).MakeGenericType (typeof (int), typeof (int));
    // public static Type t = typeof (C1<int>.C2<int>); -> OK

Actual Results:  
** ERROR **: VAR (1) cannot be expanded in this context with 1 instantiations

Expected Results:  
print C1`1+C2`1[System.Int32,System.Int32]

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

More information about the mono-bugs mailing list