---- struct Appender() { bool canExtend = false; } struct CustomFloat() { union ToBinary { CustomFloat!() get; } void opAssign(F)(F input) if (__traits(compiles, cast(real)input)) { } real get()() { Appender!() app; assert(false); } T opCast(T)() { return get!(); } alias g = get!(); } void f() { alias FPTypes = CustomFloat!(); } ---- Encountered here: https://github.com/dlang/phobos/pull/4280 Works with 2.071.0. Git master (7c3ccd8) fails with: ---- dmd: todt.c:787: void membersToDt(AggregateDeclaration*, DtBuilder&, Expressions*, size_t, ClassDeclaration*, BaseClass***): Assertion `vd->semanticRun >= PASSsemantic2done' failed. Aborted (core dumped) ----
https://github.com/dlang/dmd/pull/5780
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/201b124e6c1784c19bdd012bdec7577452d82338 fix Issue 15992 - ICE with field variable of instantiated struct When a template is instantiated in function body, it usually gets no chance to run `semantic2`, because inserted module's `semanticRun` would be greater than `PASSsemantic2done` (function bodies are analyzed in global `semantic3` stage). Therefore we should append template instances to global deferred `semantic2` list as same as for `semantic3`. https://github.com/dlang/dmd/commit/298d0102d27a50ef048c3bceb6761b470b4bc18c Merge pull request #5780 from 9rnsr/fix15992 [REG2.072a] Issue 15992 - ICE with field variable of instantiated struct
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/201b124e6c1784c19bdd012bdec7577452d82338 fix Issue 15992 - ICE with field variable of instantiated struct https://github.com/dlang/dmd/commit/298d0102d27a50ef048c3bceb6761b470b4bc18c Merge pull request #5780 from 9rnsr/fix15992