digitalmars.D.bugs - [Issue 20389] New: __traits(isDisabled) with invalid template function
- d-bugmail puremagic.com (33/33) Nov 13 2019 https://issues.dlang.org/show_bug.cgi?id=20389
https://issues.dlang.org/show_bug.cgi?id=20389 Issue ID: 20389 Summary: __traits(isDisabled) with invalid template function Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: john.michael.hall gmail.com If you disable a templated function that is not valid and then try to call __traits(isDisabled) on it with the template instantiated with something other than a type, then you will get a message that the template instance does not match the declaration. However, it does not tell you why. For instance, in the code below, T should also be part of the template, but you can only find that out if you actually call foo. disable T[] foo(U)(T[] x, T rhs) { return x ~ rhs; } unittest { static assert(__traits(isDisabled, foo!"~")); } I would reiterate that this seems to be related to using something other than a type in the instantiation. If I try the code below, then it tells me that T is an undefined identifier. unittest { static assert(__traits(isDisabled, foo!(int))); } --
Nov 13 2019