Bug 4022 – [CTFE] AA get

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-03-28T06:40:00Z
Last change time
2011-10-06T23:30:28Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2010-03-28T06:40:18Z
This program, compiled with dmd 2.042: int foo() { int[int] aa = [1: 1]; int r = aa.get(1, 1000); return 1; } enum _ = foo(); void main() {} Generates the errors: ...\dmd\src\druntime\import\object.di(366): Error: Cannot interpret key in *cast(int[int]*)&this.p at compile time test.d(5): Error: cannot evaluate aa.get(1,delegate int() { return 1000; } ) at compile time test.d(8): Error: cannot evaluate foo() at compile time test.d(8): Error: cannot evaluate foo() at compile time
Comment #1 by clugdbug — 2011-10-06T03:54:59Z
This is D2-only.
Comment #2 by bugzilla — 2011-10-06T23:30:28Z