[Issue 13122] New: std.algorithm.cartesianProduct output type immutability

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Jul 13 05:57:15 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13122

          Issue ID: 13122
           Summary: std.algorithm.cartesianProduct output type
                    immutability
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Phobos
          Assignee: nobody at puremagic.com
          Reporter: bearophile_hugs at eml.cc

void main() {
    import std.algorithm: cartesianProduct;
    immutable a = "ABC";
    foreach (t1; cartesianProduct(a, a))
        pragma(msg, typeof(t1));
    immutable b = "ABC"d;
    foreach (t2; cartesianProduct(b, b))
        pragma(msg, typeof(t2));
}


The latest dmd 2.066beta3 outputs:

Tuple!(dchar, dchar)
Tuple!(immutable(dchar), immutable(dchar))


Expected output:

Tuple!(dchar, dchar)
Tuple!(dchar, dchar)

--


More information about the Digitalmars-d-bugs mailing list