Bug 13296 – User defined types matches typed template rather than aliased as best match
Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2014-08-15T13:02:00Z
Last change time
2014-08-15T14:13:37Z
Assigned to
nobody
Creator
simendsjo
Comments
Comment #0 by simendsjo — 2014-08-15T13:02:43Z
This is a change in master.
I find the new behavior more consistent and better than the previous, but it might be a regression rather than a bugfix (by bugzilla-fu isn't very good).
In 2.065, passing a user-defined type would match an alias parameter before a type parameter. See the following example.
The following code prints
2.065: T int, alias S
2.066: T int, T S
template t(T) {
pragma(msg, "T ", T.stringof);
alias t = T;
}
template t(alias T) {
pragma(msg, "alias ", T.stringof);
alias t = T;
}
void main() {
struct S {}
t!int i; // 2.065: T, 2.066: T
t!S s; // 2.065: alias, 2.066: T
}
Comment #1 by dlang-bugzilla — 2014-08-15T14:13:37Z
*** This issue has been marked as a duplicate of issue 12261 ***