[Mono-bugs] [Bug 599469] Generic class with nested class causes mono crash (with test case)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Apr 24 10:18:30 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=599469

http://bugzilla.novell.com/show_bug.cgi?id=599469#c1


--- Comment #1 from Ole Hyldahl Tolshave <ohh at scisoft.dk> 2010-04-24 14:18:29 UTC ---
* It makes no difference if the classes GPD or GC are abstract or not.
* If the class GC is changed from a nested type of GPD to a nested type of
Grid, then the program executes without error. See this example:
public class Grid<CT>
        where CT : Grid<CT>.GC, new()
{
        public abstract class GPD
        {
                public GPD()
                {
                        ctInst = new CT();
                }

                public readonly CT ctInst;
        }

        public abstract class GC
        {
        }
}

public class H : Grid<H.MyCT>.GPD
{
        public class MyCT : Grid<H.MyCT>.GC
        {
                // When no explicit default constructor is present GMCS fails
to compile the file.
                // When it is present the execution crashes on mono.
                public MyCT () {}
        }
}

public class TheTest
{
        public static void Main (string[] args)
        {
                new H();
        }
}

-- 
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