783 – Cannot use an array w/ const or variable index as new[] size argument.

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 783 - Cannot use an array w/ const or variable index as new[] size argument.
Summary: Cannot use an array w/ const or variable index as new[] size argument.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: yebblies
URL:
Keywords: pull, rejects-valid
: 2712 3823 (view as issue list)
Depends on:
Blocks:
Reported: 2007年01月01日 12:18 UTC by Dave
Modified: 2015年06月09日 05:11 UTC (History)
5 users (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 Dave 2007年01月01日 12:18:12 UTC
const arr = [ 1,2,3 ];
void main()
{
 int[] ar2;
 ar2 = new int[arr[2]]; // OK
 const i = 2;
 ar2 = new int[arr[i]]; // "need size of rightmost array, not type arr[i]"
 size_t j = 2;
 ar2 = new int[arr[j]]; // "need size of rightmost array, not type arr[j]"
}
Comment 2 Stewart Gordon 2007年09月18日 16:24:11 UTC
Please remember to assign keywords to bug reports. To everybody reading this: Please look through issues you've reported and check for missing keywords.
Comment 3 Matti Niemenmaa 2010年02月18日 11:38:38 UTC
*** Issue 3823 has been marked as a duplicate of this issue. ***
Comment 4 yebblies 2012年02月01日 06:44:15 UTC
https://github.com/D-Programming-Language/dmd/pull/679 
Comment 5 yebblies 2012年02月01日 07:28:52 UTC
*** Issue 2712 has been marked as a duplicate of this issue. ***
Comment 6 Walter Bright 2012年02月01日 14:13:40 UTC
Please use 'pull' keyword for ones with a pull request.
Comment 7 github-bugzilla 2012年03月08日 14:05:09 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/97b4410ba1c55d77f54821249d048add3c2acd47
Merge pull request #679 from yebblies/issue783
Issue 783 - Cannot use an array w/ const or variable index as new[] size argument.


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