[Issue 7686] template argument ignored with specialization for dependent parameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 16 10:23:28 UTC 2021


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

RazvanN <razvan.nitu1305 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305 at gmail.com
         Resolution|---                         |WORKSFORME

--- Comment #2 from RazvanN <razvan.nitu1305 at gmail.com> ---
The code example in [1] now compiles successfully, as it should. The code
example in [2] fails the first 2 asserts. That is the correct behavior IMHO.
The first and second Pair instantiations match both overloads and the third one
matches a single template (the one that is not specialized on U). What else
could be the correct behavior?

For example, in [1], both:

static assert(__traits(compiles, foo!(Pair!(double, short), short)));
static assert(__traits(compiles, bar!(Pair!(double, short), short)));

and

static assert(__traits(compiles, foo!(Pair!(double, int), int)));
static assert(__traits(compiles, bar!(Pair!(double, int), int)));

compile successfully.

Closing as WORKSFORME. Please reopen if I am missing something. 

[1] https://issues.dlang.org/show_bug.cgi?id=7686#c0
[2] https://issues.dlang.org/show_bug.cgi?id=7686#c1

--


More information about the Digitalmars-d-bugs mailing list