Bug 5304 – Cannot access __dollar in pure function

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-12-01T12:52:00Z
Last change time
2012-02-26T08:41:37Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2010-12-01T12:52:21Z
pure void foo(T...)(T args) { auto x = args[1 .. $]; } void main() { foo(1, 2); } DMD 2.050 shows: test.d(2): Error: pure function 'foo' cannot access mutable static data '__dollar' test.d(5): Error: template instance test.foo!(int,int) error instantiating If I remove "pure" the error vanishes.
Comment #1 by kennytm — 2012-02-26T08:41:37Z
Apparently fixed.