3205 – CTFE: $ cannot be used in lvalues

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3205 - CTFE: $ cannot be used in lvalues
Summary: CTFE: $ cannot be used in lvalues
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: patch, rejects-valid
Depends on:
Blocks:
Reported: 2009年07月23日 23:55 UTC by Don
Modified: 2014年04月18日 09:12 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Don 2009年07月23日 23:55:20 UTC
int bar()
{
 int [] x = [0, 1, 2];
 x[x.length-1] = 5; // works
 x[$-1] = 5; // fails
 return 0;
}
int z = bar();
---
ctfe.d(6): Error: variable __dollar is used before initialization
ctfe.d(10): Error: cannot evaluate bar() at compile time
I have a patch for this, together with 2569 and 1948.
Comment 1 Don 2009年07月24日 02:20:31 UTC
Patch included in patch for bug#2569.
Comment 2 Walter Bright 2009年09月03日 13:27:36 UTC
Fixed dmd 1.047 and 2.032


AltStyle によって変換されたページ (->オリジナル) /