[Issue 1196] New: regression: "cannot alias an expression"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 27 10:59:32 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1196

           Summary: regression: "cannot alias an expression"
           Product: D
           Version: 1.013
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: thomas-dloop at kuehne.cn


This is an interresting case because small - and seemingly unrelated changes - 
can cause the message to vanish:


# template removeSpace(char[] s, int x = 0) {
#    static if (s[0] == ' '){
#       alias removeSpace!(s[1..$], x+1) removeSpace;
#    }else{
#       alias s removeSpace;
#    }
# }
#
# struct Tuple(A...) {
#    alias A Tuple;
# }

# static assert("Hello you !" == removeSpace!("       Hello you !"));
compile/t/tuple_21_B.d(14): alias dstress.compile.t.tuple_21_B.removeSpace!(" 
Hello you !",6).removeSpace cannot alias an expression "Hello you !"

# static assert("Hello you !" == removeSpace!("       Hello you !").Tuple[0]);
succeeds

test cases:
http://dstress.kuehne.cn/nocompile/t/template_21_A.d
http://dstress.kuehne.cn/nocompile/t/template_21_B.d
http://dstress.kuehne.cn/run/template_12.d


-- 



More information about the Digitalmars-d-bugs mailing list