[Issue 7621] New: Immutable type equivalence problem
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Mar 1 13:14:50 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7621
Summary: Immutable type equivalence problem
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2012-03-01 13:14:49 PST ---
I don't understand this bug. D2 code:
void main() {
enum uint N = 4u;
char[] A = "hello".dup;
uint[immutable char[N]] dict;
dict[*cast(immutable char[4]*)(A[0 .. N].ptr)] = 0; // OK
dict[*cast(immutable char[N]*)(A[0 .. N].ptr)] = 0; // line 6, error
}
DMD 2.059head gives:
test.d(6): Error: cannot implicitly convert expression
(*cast(immutable(char[N]*))cast(char*)A[0u..4u]) of type immutable(char[N]) to
immutable(char[4u])
--
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