[Issue 8980] New: no implicit cast to const for AA
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Nov 8 07:21:13 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8980
Summary: no implicit cast to const for AA
Product: D
Version: D2
Platform: x86_64
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: puremagic at mikevandongen.nl
--- Comment #0 from Mike van Dongen <puremagic at mikevandongen.nl> 2012-11-08 07:21:12 PST ---
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);
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list