http://d.puremagic.com/issues/show_bug.cgi?id=9048
Summary: Error: base classes expected instead of typeof when
instantiating anonymous class
Product: D
Version: D2
Platform: x86_64
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from ogondza <[email protected]> 2012-11-19 15:18:45 PST ---
Unlike, regular classes, anonymous classes seems to be impossible to
instantiate when using typeof expression.
This works perfectly:
new typeof(this)();
new typeof(new Object())();
But these
new class typeof(this) {};
new class typeof(new Object()) {};
give (on v2.060)
Error: base classes expected instead of typeof
Error: { members } expected for anonymous class
Error: found 'typeof' when expecting ';' following statement
It can be worked around aliasing the type first and then instantiating
anonymous class of the aliased type. However, for an anonymous class it is
necessary to instantiate in one expression.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------