http://d.puremagic.com/issues/show_bug.cgi?id=8657
Summary: TypeInfo generated for const/immutable static arrays not transitive Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: r.sagita...@gmx.de --- Comment #0 from Rainer Schuetze <r.sagita...@gmx.de> 2012-09-14 01:29:37 PDT --- This test program import std.stdio; void test(T)() { T p; writeln("=============="); writeln("p: ", typeid(p)); TypeInfo ti = typeid(p); TypeInfo_Const cti = cast(TypeInfo_Const)ti; writeln("p[0] : ", typeid(p[0])); writeln("ti.next : ", cast(TypeInfo)ti.next); // cannot write const(TypeInfo) writeln("cti.base : ", cti.next); } void testMod(T)() { test!(const(T))(); test!(immutable(T))(); test!(shared(T))(); } void main() { testMod!(int*)(); testMod!(int[])(); testMod!(int[2])(); // testMod!(int[2][3])(); } outputs: ============== p: const(const(int)*) p[0] : const(int) ti.next : const(int) cti.base : const(int)* ============== p: immutable(immutable(int)*) p[0] : immutable(int) ti.next : immutable(int) cti.base : immutable(int)* ============== p: shared(shared(int)*) p[0] : shared(int) ti.next : shared(int) cti.base : shared(int)* ============== p: const(const(int)[]) p[0] : const(int) ti.next : const(int) cti.base : const(int)[] ============== p: immutable(immutable(int)[]) p[0] : immutable(int) ti.next : immutable(int) cti.base : immutable(int)[] ============== p: shared(shared(int)[]) p[0] : shared(int) ti.next : shared(int) cti.base : shared(int)[] ============== p: const(int[2]) p[0] : const(int) ti.next : int cti.base : int[2] ============== p: immutable(int[2]) p[0] : immutable(int) ti.next : int cti.base : int[2] ============== p: shared(shared(int)[2]) p[0] : shared(int) ti.next : shared(int) cti.base : shared(int)[2] It shows that the next and base properties of the TypeInfo generated for const(int[2]) and immutable(int[2]) lose the qualifier. This does not happen for "shared". -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------