www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16050] New: Template type parameter "action at at a distance"


          Issue ID: 16050
           Summary: Template type parameter "action at at a distance"
           Product: D
           Version: D2
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: thomas.bockman gmail.com

"vit" on the D.lang forum found this bug:
    http://forum.dlang.org/post/fiaqxpgaxttgifnkyzpk forum.dlang.org

Starting with the following declarations:
class Type { }

class Foo(T : const T) {
    alias X = T;

alias Bar(T : Foo!Ts, Ts...) = Ts[0];

This will print "immutable(Type):
alias F1 = Foo!(immutable(Type));
alias F2 = Foo!Type;

pragma(msg, "Bar: ", Bar!(Foo!Type)); // Bar: immutable(Type)

But this will print just "Type":
alias F1 = Foo!Type;
alias F2 = Foo!(immutable(Type));

pragma(msg, "Bar: ", Bar!(Foo!Type));  // Bar: Type

The type of Bar!(Foo!Type) should not be effected by the existence or order of
F1 and F2 above.

May 20 2016