Bug 12111 – Cannot pull a function template into an overload set
Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-08T12:46:24Z
Last change time
2018-02-25T12:24:00Z
Assigned to
No Owner
Creator
Nick Sabalausky
Comments
Comment #0 by bus_dbugzilla — 2014-02-08T12:46:24Z
Works with regular functions, but not function templates:
------------------------------
module a;
import b;
alias foo = b.foo;
void foo(T)(T t) if(is(T==char)) {}
void main() { foo(1); }
------------------------------
module b;
void foo(T)(T t) if(is(T==int)) {}
------------------------------
Error: template a.foo(T)(T t) if (is(T == char)) conflicts with alias a.foo at a.d(4)
FWIW, The problem does not appear to be related to the "if(...)" constraints, because using these foo's has the same problem:
void foo(T)(int[T] t) {}
void foo(T)(T[] t) {}
Comment #1 by bus_dbugzilla — 2014-02-08T13:22:53Z