[Issue 11195] New: Error messages not suppressed in __traits(compiles, ...)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 8 05:10:16 PDT 2013


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

           Summary: Error messages not suppressed in
                    __traits(compiles,...)
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: simen.kjaras at gmail.com


--- Comment #0 from Simen Kjaeraas <simen.kjaras at gmail.com> 2013-10-08 05:10:15 PDT ---
import std.traits : ParameterTypeTuple;

void foo()() {}

void main() {
    assert(!__traits(compiles, {struct A{ParameterTypeTuple!foo tmp;}}));
}

The above program fails to compile with this message:
bug.d(6): Error: template instance ParameterTypeTuple!(foo) does not match
template declaration ParameterTypeTuple(func...) if (func.length == 1 &&
isCallable!func)

Replace ParameterTypeTuple!foo with a simple type, and things work wonderfully.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list