Bug 8776 – pure static this can't access inhexistant field __gate

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-10-07T13:25:00Z
Last change time
2013-11-24T04:34:24Z
Keywords
diagnostic, rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2012-10-07T13:25:13Z
struct Foo(size_t N) { pure static this() {} } void main() { Foo!1 f1; } DMD 2.061alpha refuses code that seems OK giving some error that lack a line number: Error: pure function 'bug.Foo!(1).Foo._staticCtor2' cannot access mutable static data '__gate' Error: pure function 'bug.Foo!(1).Foo._staticCtor2' cannot access mutable static data '__gate' bug.d(5): Error: template instance bug.Foo!(1) error instantiating
Comment #1 by yebblies — 2013-11-24T04:34:24Z
*** This issue has been marked as a duplicate of issue 7533 ***