Bug 8980 – no implicit cast to const for AA

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2012-11-08T07:21:12Z
Last change time
2024-12-13T18:02:32Z
Assigned to
No Owner
Creator
Mike van Dongen
Moved to GitHub: dmd#18488 →

Comments

Comment #0 by puremagic — 2012-11-08T07:21:12Z
In the following example I'm trying to compare 2 AA's of which 1 is const. const string[string] a = ["lang": "D"]; string[string] b = ["lang": "D"]; assert(a == b); The compiler gives the following error: Error: incompatible types for ((a) == (b)): 'const(immutable(char)[][string])' and 'string[string]' When I explicitly cast b to const, it does work. assert(a == cast(const) b);
Comment #1 by robert.schadek — 2024-12-13T18:02:32Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18488 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB