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]" }
Added to DStress as http://dstress.kuehne.cn/run/a/array_initialization_32_A.d http://dstress.kuehne.cn/run/a/array_initialization_32_B.d http://dstress.kuehne.cn/run/a/array_initialization_32_C.d http://dstress.kuehne.cn/run/a/array_initialization_32_D.d
Please remember to assign keywords to bug reports. To everybody reading this: Please look through issues you've reported and check for missing keywords.
*** Issue 3823 has been marked as a duplicate of this issue. ***
https://github.com/D-Programming-Language/dmd/pull/679
*** Issue 2712 has been marked as a duplicate of this issue. ***
Please use 'pull' keyword for ones with a pull request.
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 によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル