[Issue 8742] Anonymous nested class derived from another nested class makes DMD crash
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jan 11 00:12:04 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8742
--- Comment #3 from Kenji Hara <k.hara.pg at gmail.com> 2013-01-11 00:12:02 PST ---
(In reply to comment #1)
> 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?
Seems reasonable.
In the case, anonymous class typeof(d) requires two context pointers, one is of
'c', one another is of 'main'. But it is disallowed.
So, the original code should be an error in my opinion.
--
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