[Issue 9461] Ability to break typesystem with `inout`
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Feb 6 19:57:33 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9461
--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> 2013-02-06 19:57:28 PST ---
Similar problem exists in:
- AA key conversion
- AA value conversioin
- Pointer target conversion
- static to dynamic array conversion
But, bare class conversion inout(B) to inout(A) still be allowed.
Test case:
----
class A {}
class B : A {}
void conv1(inout(B)[] x) { inout(A)[] y = x; } // should be NG
void conv2(int[inout(B)] x) { int[inout(A)] y = x; } // should be NG
void conv3(inout(B)[int] x) { inout(A)[int] y = x; } // should be NG
void conv4(inout(B)* x) { inout(A)* y = x; } // should be NG
void conv5(ref inout(B)[1] x) { inout(A)[] y = x; } // should be NG
void conv6(inout(B) x) { inout(A) y = x; } // should be OK
--
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