← Back to index
|
Original Bugzilla link
Bug 13919 – typeof(T.init[].front.init) crashes compiler for T = std.container.Array!int
Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-12-31T13:05:56Z
Last change time
2018-10-10T22:49:05Z
Keywords
ice
Assigned to
No Owner
Creator
Tobias Pankrath
Comments
Comment #0
by tobias — 2014-12-31T13:05:56Z
Tested with ~master: --- import std.container; alias T = Array!int; pragma(msg, typeof(T.init[].front.init)); /tmp/test.d(5): called from here: Array(RefCounted(RefCountedStore(null))).opSlice() dmd: interpret.c:752: Expression* ctfeInterpret(Expression*): Assertion `global.errors != olderrors' failed. zsh: abort (core dumped) ~/projekte/d/dmd/src/dmd /tmp/test.d
Comment #1
by k.hara.pg — 2015-01-20T01:54:21Z
Reduced test case: alias T = Array!int; pragma(msg, typeof(T.init[].front.init)); struct RefCounted(T) { //struct RefCountedStore //{ struct Impl { T _payload; size_t _count; } Impl* _store; //} //RefCountedStore _refCounted; ~this() {} // necessary @property ref inout(T) refCountedPayload() inout { return /*_refCounted.*/_store._payload; } alias refCountedPayload this; } struct Array(T) { struct Payload { size_t _capacity; T[] _payload; } RefCounted!Payload _data; static struct Range { Array _outer; this(ref Array data) // necessary { //_outer = data; } @property ref T front() { return _outer._data._payload[_a]; } } Range opSlice() { return Range(this); } }
Comment #2
by n8sh.secondary — 2018-10-10T22:49:05Z
Verified working with DMD v2.082.0.