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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 11 11:48:04 PDT 2012


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



--- Comment #1 from dawg at dawgfoto.de 2012-03-11 11:48:11 PDT ---
cat > bug.d << CODE
struct Pair(T1, T2) {}

template foo(T : Pair!(T, U), U)
{
    enum val = 0;
}

template foo(T : Pair!(T, U), U:int)
{
    enum val = 1;
}

static assert(foo!(Pair!(int, int)).val == 1);   // FAIL - matches both
static assert(foo!(Pair!(int, short)).val == 1); // FAIL - matches the first
static assert(foo!(Pair!(int, float)).val == 0); // OK   - matches the first
CODE

dmd -c bug

--------

This also behaves incorrect for specialized overloads.

-- 
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