D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5304 - Cannot access __dollar in pure function
Summary: Cannot access __dollar in pure function
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2010-12-01 12:52 UTC by bearophile_hugs
Modified: 2012-02-26 08:41 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2010-12-01 12:52:21 UTC
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 kennytm 2012-02-26 08:41:37 UTC
Apparently fixed.