[Issue 12520] New: Comparing two TypeTuples with == does not compile for no arguments

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 4 06:37:42 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12520

           Summary: Comparing two TypeTuples with == does not compile for
                    no arguments
           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> 2014-04-04 06:37:40 PDT ---
assert(TypeTuple!1 == TypeTuple!1);
    assert(TypeTuple!("foo", 12.6) == TypeTuple!("foo", 12.6));

These lines compile. This line does not:

    assert(TypeTuple!() == TypeTuple());

The error message is:

    Error: incompatible types for ((()) == (())): cannot use '==' with types

In the case of generic code, this is problematic - if I have a type that can
take a variable number of arguments that are all required to be values, not
types, I have to special case comparison of empty args, or resort to weird
tricks like using a templated wrapper struct and comparing the types of two
wrappers:

    struct CMP(T...){}

    assert(is(CMP!args1 == CMP!args2));

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


More information about the Digitalmars-d-bugs mailing list