Bug 7695 – Regression(2.058): ICE(mtype.c) on associative array with keys of struct type with const members

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-03-12T19:26:00Z
Last change time
2012-04-09T20:43:18Z
Keywords
ice
Assigned to
nobody
Creator
simen.kjaras

Comments

Comment #0 by simen.kjaras — 2012-03-12T19:26:50Z
struct Bar { const int t; } void main( ) { int[Bar] a; int n = a.length; } Assertion failure: 'impl' on line 4407 in file 'mtype.c' abnormal program termination
Comment #1 by bus_dbugzilla — 2012-04-09T13:20:23Z
This is a regression that was introduced in 2.058
Comment #2 by bus_dbugzilla — 2012-04-09T13:25:42Z
Don't know if this helps, but the problem also occurs if you replace const int t; with: const opEquals(Bar ) {} The function must be named opEquals. If it's named "foo", the ICE goes away.
Comment #3 by github-bugzilla — 2012-04-09T20:41:47Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/d46fde7cc0fc4bad25213aee137fd2eeeb2a63af fix Issue 7695 - Regression(2.058): ICE(mtype.c) on associative array with keys of struct type with const members
Comment #4 by bugzilla — 2012-04-09T20:43:18Z
The problem here is the const member needs an initializer. The error was suppressed and ignored, though, causing the compiler to later fail.