ICE for DMD 2.071: //============================================================================== class DB { } //============================================================================== Query where(alias pred, Query)(Query ) { auto p = Where!(); pred(p); // record predicate } struct Where() { auto opDispatch(string name)() { alias FieldType = typeof(getMember); WhereField!FieldType; } } struct WhereField(FieldType) { }void main() { auto db = DB; db.where!(p => p.name ); } ============================= ..\test.d(30): Error: type DB has no value ..\test.d(11): Error: type Where!() has no value object.Error@(0): Access Violation ---------------- 0x004EC058
Reduced further: ---- void where() { Where().name; } struct Where { void opDispatch(string name)() { alias FieldType = typeof(getMember); WhereField!FieldType; } } struct WhereField(FieldType) {} ---- Doesn't segfault with 2.068.2 and earlier.
https://github.com/dlang/dmd/pull/5925
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/8fbedf504bed737241f734f7c8883693ba069472 fix Issue 16188 - [REG2.069] ICE on invalid code https://github.com/dlang/dmd/commit/920e870e848e7668a15219cb004e422e25448d3e removed change in declaration.d unrelated to Issue 16188 - I assume it was an attempt at showing the correct error message during opDispatch semantics (by rerunning semantic). But as we still get the wrong error message and this change isn't necessary to fix 16188, we better not merge it into stable. https://github.com/dlang/dmd/commit/b3c0283c4b2acbc24919c9dfdb0f68a7ba1f2bfb Merge pull request #5927 from MartinNowak/fix16188 fix Issue 16188 - [REG2.069] ICE on invalid code
*** Issue 16276 has been marked as a duplicate of this issue. ***
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/8fbedf504bed737241f734f7c8883693ba069472 fix Issue 16188 - [REG2.069] ICE on invalid code https://github.com/dlang/dmd/commit/920e870e848e7668a15219cb004e422e25448d3e removed change in declaration.d unrelated to Issue 16188 https://github.com/dlang/dmd/commit/b3c0283c4b2acbc24919c9dfdb0f68a7ba1f2bfb Merge pull request #5927 from MartinNowak/fix16188