D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 774 - indexing / slicing a const arrays causes: "Error: non-constant expression"
Summary: indexing / slicing a const arrays causes: "Error: non-constant expression"
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2006-12-30 07:49 UTC by Thomas Kühne
Modified: 2014-02-15 13:18 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Thomas Kühne 2006-12-30 07:49:51 UTC
works:
#
# const A = (["abc", "789"])[0];
#

fails:
#
# const B = ["abc", "789"];
# const C = B[0];
#
Comment 1 Thomas Kühne 2006-12-30 20:09:23 UTC
fixed Deskzilla's standard priority
Comment 2 strtr 2010-07-21 23:04:47 UTC
Compiles with D1.062