D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 16403 - wrong "matches more than one template declaration" error with template specialization on alias parameters
Summary: wrong "matches more than one template declaration" error with template specia...
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2016-08-18 22:40 UTC by ag0aep6g
Modified: 2024-12-13 18:49 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ag0aep6g 2016-08-18 22:40:29 UTC
----
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 */
----
Comment 1 dlangBugzillaToGithub 2024-12-13 18:49:30 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/19171

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB