Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong "matches more than one template declaration" error with template specialization on alias parameters #19171

Open
dlangBugzillaToGithub opened this issue Aug 18, 2016 · 0 comments

Comments

@dlangBugzillaToGithub
Copy link

ag0aep6g reported this on 2016-08-18T22:40:29Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=16403

Description

----
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 */
----
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant