← Back to index
|
Original Bugzilla link
Bug 15025 – duplicate array initializers are only checked in todt glue code
Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-09-07T22:21:26Z
Last change time
2024-12-13T18:44:35Z
Assigned to
No Owner
Creator
Martin Nowak
Moved to GitHub: dmd#19039 →
Comments
Comment #0
by code — 2015-09-07T22:21:26Z
cat > bug.d << CODE void main() { import std.stdio; int[] ary = [0: 1, 2, 1: 3]; // silently overwrites 2 writeln(ary); } CODE dmd -run bug ---- [1, 3] ---- cat > bug.d << CODE int[] ary = [0: 1, 2, 1: 3]; // fails during data emission in glue layer void main() { import std.stdio; writeln(ary); } CODE dmd -run bug ---- bug.d(1): Error: duplicate initializations for index ---- Both programs should have the same result and to avoid silently overwriting an already initialized element, both programs should error.
Comment #1
by robert.schadek — 2024-12-13T18:44:35Z
THIS ISSUE HAS BEEN MOVED TO GITHUB
https://github.com/dlang/dmd/issues/19039
DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB