Bug 9459 – Front-end does not detect invalid array operations

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-05T22:58:00Z
Last change time
2013-11-23T03:05:14Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2013-02-05T22:58:00Z
In this code, all static assertions should pass, but fails. void main() { int[] a = [1, 2, 3]; static assert(!__traits(compiles, { a = -a[]; })); static assert(!__traits(compiles, { a = ~a[]; })); static assert(!__traits(compiles, { a = a[] + a[]; })); static assert(!__traits(compiles, { a = a[] - a[]; })); static assert(!__traits(compiles, { a = a[] * a[]; })); static assert(!__traits(compiles, { a = a[] / a[]; })); static assert(!__traits(compiles, { a = a[] % a[]; })); static assert(!__traits(compiles, { a = a[] ^ a[]; })); static assert(!__traits(compiles, { a = a[] & a[]; })); static assert(!__traits(compiles, { a = a[] | a[]; })); static assert(!__traits(compiles, { a = a[] ^^ a[]; })); }
Comment #1 by yebblies — 2013-11-23T00:33:45Z
Comment #2 by github-bugzilla — 2013-11-23T03:04:18Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/8d7d4ff2812718f635a17a2a96752bce447c4216 Fix Issue 9459 - Front-end does not detect invalid array operations https://github.com/D-Programming-Language/dmd/commit/ac1c6120557b9a8244ff23835332e60030b7b0fa Merge pull request #2861 from yebblies/issue9459 Issue 9459 - Front-end does not detect invalid array operations