← Back to index
|
Original Bugzilla link
Bug 7533 – Error with no line number with pure static ctor
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-02-17T09:55:00Z
Last change time
2013-11-24T04:34:24Z
Keywords
diagnostic
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0
by bearophile_hugs — 2012-02-17T09:55:39Z
immutable struct Foo(int n) { pure static this() {} } void main() { Foo!5 foo; } DMD 2.058 gives: Error: pure function '_staticCtor2' cannot access mutable static data '__gate' test2.d(5): Error: template instance test2.Foo!(5) error instantiating
Comment #1
by clugdbug — 2012-02-17T11:58:55Z
That's a terrible error message. Bug 3243 is related.
Comment #2
by github-bugzilla — 2013-05-31T09:16:39Z
Commits pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/ef183a175926568f6757a8037cdaf1aa26489375
fix issue 7533 - Error with no line number with pure static ctor
https://github.com/D-Programming-Language/dmd/commit/dc11daccfdfa5d7393017149b16877d9057ce36d
Merge pull request #2108 from hpohl/7533 fix issue 7533 - Error with no line number with pure static ctor
Comment #3
by yebblies — 2013-11-24T04:34:24Z
*** Issue 8776 has been marked as a duplicate of this issue. ***