Bug 9168 – AA.length is impure and unsafe

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-12-16T22:18:00Z
Last change time
2012-12-18T17:13:09Z
Assigned to
nobody
Creator
lt.infiltrator

Comments

Comment #0 by lt.infiltrator — 2012-12-16T22:18:32Z
This code fails to compile: ------------------------ void main() pure @safe { int[int] aa; aa.length == 0; } ------------------------ /home/c213/c231.d(3): Error: pure function 'main' cannot call impure function 'length' /home/c213/c231.d(3): Error: safe function 'main' cannot call system function 'length'
Comment #1 by bearophile_hugs — 2012-12-17T04:08:57Z
I think this a duplicated.
Comment #2 by lt.infiltrator — 2012-12-18T17:13:09Z
*** This issue has been marked as a duplicate of issue 5555 ***