Bug 9458 – ModExp generates invalid code against array operands
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-05T22:48:00Z
Last change time
2013-02-06T00:48:12Z
Keywords
accepts-invalid, pull, wrong-code
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2013-02-05T22:48:41Z
In this code, line 4 is not valid array-operation. But, compiler accepts such invalid code.
Note that: slice expression MUST appear in LHS operand for valid array operation.
void main()
{
int[] a = [1, 2, 3];
a = a[] % a[]; // line 4
import std.stdio;
writeln(a); // prints "[]"
}