Bug 15992 – [REG2.072a] ICE with field variable of instantiated struct

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-05-04T19:16:00Z
Last change time
2016-10-01T11:47:18Z
Keywords
ice, pull
Assigned to
nobody
Creator
ag0aep6g
Blocks
15995

Comments

Comment #0 by ag0aep6g — 2016-05-04T19:16:31Z
---- 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) ----
Comment #1 by k.hara.pg — 2016-05-15T15:28:54Z
Comment #2 by github-bugzilla — 2016-07-10T05:52:36Z
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
Comment #3 by github-bugzilla — 2016-10-01T11:47:18Z
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