Bug 3903 – Traits compiles as true for an array sum with wrong syntax
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-03-08T15:04:00Z
Last change time
2013-12-14T05:46:50Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2010-03-08T15:04:06Z
This compiles, but the traits has to return 'false' here:
void main() {
int[2] a = [1, 2];
assert( __traits(compiles, {return a + a;}) );
//auto r = a + a; // error
}
See also bug 3817 .