Bug 13024 – [ICE](expression.c line 1172) with implicit supertype conversion of different enums in array literal

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-02T22:17:00Z
Last change time
2014-08-22T08:04:19Z
Keywords
ice, pull
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2014-07-02T22:17:02Z
void main() { import std.typecons; enum A { a } enum B { b } int i = 1; Tuple!(A, B) t; auto r = [t[]][i]; } test.d(7,15): Error: cannot implicitly convert expression (t._expand_field_0) of type A to B Assertion failure: 'e->op != TOKerror' on line 1172 in file 'expression.c' Reduced: enum A { a } enum B { b } struct T { A x; B y; } void main() { T t; auto r1 = [int(t.x), int(t.y)]; // OK auto r2 = [t.tupleof]; // crash } test.d(7,16): Error: cannot implicitly convert expression (t.x) of type A to B Assertion failure: 'e->op != TOKerror' on line 1172 in file 'expression.c'
Comment #1 by k.hara.pg — 2014-07-10T01:38:23Z
Comment #2 by bearophile_hugs — 2014-07-10T07:55:44Z
(In reply to Kenji Hara from comment #1) > https://github.com/D-Programming-Language/dmd/pull/3733 As discussed in the pull request thread, currently this is only a partial fix.
Comment #3 by github-bugzilla — 2014-07-11T07:39:44Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/aec7dff579c3873894c309ccb90e190d20289b0a fix Issue 13024 - [ICE](expression.c line 1172) with implicit supertype conversion of different enums in array literal https://github.com/D-Programming-Language/dmd/commit/e0ca2d2005574aa90322deb6eb130860a6124e6f Merge pull request #3733 from 9rnsr/fix13024 [REG2.066a] Issue 13024 - [ICE](expression.c line 1172) with implicit supertype conversion of different enums in array literal
Comment #4 by bearophile_hugs — 2014-07-11T07:58:22Z
Reopened, because as explained both here and in the pull request, the pull request fixes only part of the bug. Now this code: enum A { a } enum B { b } struct T { A x; B y; } void main() { T t; auto r1 = [int(t.x), int(t.y)]; // OK auto r2 = [t.tupleof]; // error } Gives with dmd 2.066beta2: test.d(7,16): Error: cannot implicitly convert expression (t.x) of type A to B Changed the issue name a little because now it's not an ICE, it's a rejects-valid.
Comment #5 by k.hara.pg — 2014-07-11T08:59:47Z
(In reply to bearophile_hugs from comment #4) > Reopened, because as explained both here and in the pull request, the pull > request fixes only part of the bug. Now this code: ICE issue was a regression, but failing common type calculation is not regression. So change 'importance' to normal. (In next time, please file a new issue instead of reopening)
Comment #6 by bearophile_hugs — 2014-07-11T09:11:03Z
(In reply to Kenji Hara from comment #5) > (In next time, please file a new issue instead of reopening) Sorry, I close this now, and I'll reopen another one.
Comment #7 by k.hara.pg — 2014-07-11T09:20:24Z
(In reply to bearophile_hugs from comment #6) > (In reply to Kenji Hara from comment #5) > > > (In next time, please file a new issue instead of reopening) > > Sorry, I close this now, and I'll reopen another one. Thank you.
Comment #8 by github-bugzilla — 2014-07-11T14:46:56Z
Commit pushed to 2.066 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/8ca5956e10ed9637ae35911c0afae37faffd3c56 Merge pull request #3733 from 9rnsr/fix13024 [REG2.066a] Issue 13024 - [ICE](expression.c line 1172) with implicit supertype conversion of different enums in array literal
Comment #9 by github-bugzilla — 2014-08-22T08:04:19Z