[Issue 16403] New: wrong "matches more than one template declaration" error with template specialization on alias parameters
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Aug 18 15:40:29 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16403
Issue ID: 16403
Summary: wrong "matches more than one template declaration"
error with template specialization on alias parameters
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: ag0aep6g at gmail.com
----
struct S(T) {}
/* This should work, but fails: */
enum fails(alias Tmpl, alias Inst : Tmpl!A, A) = true;
enum fails(alias Tmpl, alias Inst) = false;
static assert(fails!(S, S!int)); /* Error: template test.fails matches more
than one template declaration */
/* These variations work: */
enum works1(alias Inst : S!A, A) = true;
enum works1(alias Inst) = false;
static assert(works1!(S!int)); /* passes */
enum works2(alias Tmpl, Inst : Tmpl!A, A) = true;
enum works2(alias Tmpl, Inst) = false;
static assert(works2!(S, S!int)); /* passes */
----
--
More information about the Digitalmars-d-bugs
mailing list