[Issue 1168] New: Passing a .stringof of an expression as a template	value parameter results in the string of the type
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Fri Apr 20 05:13:00 PDT 2007
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=1168
           Summary: Passing a .stringof of an expression as a template value
                    parameter results in the string of the type
           Product: D
           Version: 1.012
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: deewiant at gmail.com
(Set version as 1.012, since 1.013 wasn't in the list yet.)
template T(char[] s) {
        const char[] T = s;
}
char[] f(char[] s) {
        return s;
}
void main() {
        int foo;
        assert (foo.stringof == f(foo.stringof));  // works
        assert (foo.stringof == T!(foo.stringof)); // fails
}
T!(foo.stringof) results in "int", it should be "foo".
-- 
    
    
More information about the Digitalmars-d-bugs
mailing list