Bug 18025 – ICE with __traits(compiles)

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-12-02T08:23:30Z
Last change time
2018-03-18T15:53:51Z
Assigned to
No Owner
Creator
erikas.aubade

Comments

Comment #0 by erikas.aubade — 2017-12-02T08:23:30Z
This testcase causes an ICE for me on every version of DMD since 2.073.0 on both Windows and Linux class A { B!string[2] names() { return [null, null]; }; } class B(T, size_t idx = 0) { } class C { } template Testing(T) { private B!string[] var; static if (__traits(compiles, var = T.init.names)) { enum Testing = true; } else { enum Testing = false; } } void main() { assert (Testing!A); assert (!Testing!C); }
Comment #1 by bitter.taste — 2018-03-18T15:53:51Z
Works in master, closing this.