Bug 5211 – D1: ICE(init.c) DMD Can't handle nested aa literals

Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2010-11-13T07:44:00Z
Last change time
2013-11-25T09:20:54Z
Keywords
ice
Assigned to
nobody
Creator
doob

Comments

Comment #0 by doob — 2010-11-13T07:44:28Z
The following code: module main; void main () { auto tree = ["" : ["" : ""]]; } Using DMD 1.065 results in: Assertion failed: (0), function toExpression, file init.c, line 437.
Comment #1 by clugdbug — 2010-11-13T11:19:42Z
ICE only seems to happen on D1, but the error message on D2 is poor: Integer constant expression expected instead of "" -- and it gives the line number of the third "", whereas it wants the second "" to be an integer. Changing the second "" to an integer changes the error message to: "Error: not an associative array initializer"
Comment #2 by k.hara.pg — 2013-11-24T19:58:12Z
D1 is not supported anymore. And with D2.064, following error is reported: test.d(5): Error: not an associative array initializer
Comment #3 by bearophile_hugs — 2013-11-24T23:50:17Z
This doesn't ICE on D2, but this code should be supported in D2: auto tree = ["" : ["" : ""]];
Comment #4 by doob — 2013-11-25T00:04:22Z
(In reply to comment #3) > This doesn't ICE on D2, but this code should be supported in D2: > auto tree = ["" : ["" : ""]]; I agree. Why should it not be supported?
Comment #5 by yebblies — 2013-11-25T09:19:30Z
Don't worry, I've included this case in issue 8557. They're all related.
Comment #6 by doob — 2013-11-25T09:20:54Z
(In reply to comment #5) > Don't worry, I've included this case in issue 8557. They're all related. Ok, thanks.