Bug 7645 – ICE(e2ir.c) nested classes

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-03-04T11:12:00Z
Last change time
2013-11-27T20:04:23Z
Keywords
ice, pull
Assigned to
nobody
Creator
hoganmeier

Comments

Comment #0 by hoganmeier — 2012-03-04T11:12:39Z
class Query(string queryText) { class Entity { void[] buf; class fld(T,string varName) { T opCall() { return cast(T)buf; } } } Entity e; } void main() { scope query = new Query!"SELECT ONLY_NEEDED_COLUMNS" "FROM contacts c" "WHERE c.country = 'US'" "AND c.sales > 10000;"; auto entity = query.e; //foreach(entity; query) //{ auto email_addy = entity.fld!(char,"email")(); } $ dmd test.d entity.(fld) Internal error: e2ir.c 688
Comment #1 by andrej.mitrovich — 2012-03-04T11:18:57Z
Slightly more reduced: class Query(string queryText) { class Entity { void[] buf; class fld(T, string varName) { T opCall() { return cast(T)buf; } } } Entity e; } void main() { scope query = new Query!"SELECT ONLY_NEEDED_COLUMNS"; auto entity = query.e; auto email_addy = entity.fld!(char, "email")(); }
Comment #2 by hoganmeier — 2012-03-04T13:36:23Z
And more: class Entity { class fld() { char t; } } void main() { Entity entity; auto email_addy = entity.fld!().t; }
Comment #3 by verylonglogin.reg — 2013-10-14T03:17:49Z
*** Issue 7701 has been marked as a duplicate of this issue. ***
Comment #4 by verylonglogin.reg — 2013-10-14T03:18:06Z
It can be templated `class`, `struct`, or `union`, with function or field. Testcase from Issue 7701: --- struct S { struct S2 (T) { void fn () {} } } void main () { S s; s.S2!int.fn(); } --- Also now internal error is: e2ir.c 780
Comment #5 by k.hara.pg — 2013-11-18T06:31:57Z
Comment #6 by github-bugzilla — 2013-11-18T08:27:16Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/54d6e35d46c7af02dbb718812834e084354c31b5 fix Issue 7645 - ICE(e2ir.c) nested classes https://github.com/D-Programming-Language/dmd/commit/346988f858702f958e559f7c28d4cb92f87e0eb7 Merge pull request #2818 from 9rnsr/fix7645 Issue 7645 - ICE(e2ir.c) nested classes
Comment #7 by k.hara.pg — 2013-11-27T20:04:23Z
*** Issue 11621 has been marked as a duplicate of this issue. ***