[Issue 14362] New: DMD should compile SDC test0159.d

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Mar 28 09:55:55 PDT 2015


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

          Issue ID: 14362
           Summary: DMD should compile SDC test0159.d
           Product: D
           Version: unspecified
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: shammah.chancellor at gmail.com

```
> rdmd test0159.d
test0159.d(11): Error: template instance foo!true does not match template
declaration foo(alias T U, T)()
test0159.d(11): Error: template instance foo!10 does not match template
declaration foo(alias T U, T)()
test0159.d(11): Error: template instance foo!(5) does not match template
declaration foo(alias T U, T)()
```


```test0159.d
//T compiles:yes
//T has-passed:yes
//T retval:25
// template typed alias parameter (value)

auto foo(alias T U, T)() {
    return cast(int) (U + T.sizeof);
}

int main() {
    return foo!true() + foo!10() + foo!I();
}

enum I = 5;

```

--


More information about the Digitalmars-d-bugs mailing list