[Issue 8742] Anonymous nested class derived from another nested class makes DMD crash

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 10 07:30:04 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=8742


Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich at gmail.com


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-01-10 07:30:02 PST ---
Is this valid code to begin with?

@Kenji @Walter: `toParent2()->getType()` returns NULL, hence isBaseOf crashes
when it tries to call `t->ty` on a NULL `t`. I can add a check to `isBaseOf`,
then it will return:

test.d(11): Error: class test.main.__anonclass1 is nested within main, but
super class D is nested within C
test.d(11): Error: e.new is only for allocating nested classes

So it would turn the ICE into an error, but is that ok or is the code actually
valid?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list