[Issue 11126] New: Link failure when using instancing anonymous classes to a static variable
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Sep 26 06:07:17 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11126
Summary: Link failure when using instancing anonymous classes
to a static variable
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: link-failure
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: andrej.mitrovich at gmail.com
--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-09-26 06:07:16 PDT ---
-----
class C {}
void main()
{
static C c = new class C {};
}
-----
$ dmd test.d
Error 42: Symbol Undefined _Dmain12__anonclass16__vtblZ
However I'm not sure I understand why the above is allowed to compile
(nevermind the link failure), since the following fails to compile:
-----
class C {}
void main()
{
static /*C*/ c = new class C {};
}
-----
test.d(5): Error: variable test.main.c is mutable. Only const or immutable
class thread local variable are allowed, not test.main.__anonclass1
--
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