https://issues.dlang.org/show_bug.cgi?id=19766
Issue ID: 19766
Summary: Cannot pass overload set consisting solely of
templated functions as alias
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
Consider the following code:
// void foo(int) { }
void foo(T : int)(T) { }
void bar(T : string)(T) { }
void baz(T : bool)(T) { }
alias a = foo;
alias a = bar;
alias a = baz;
void test(alias fn)()
{
fn(0);
fn(null);
fn(true);
}
void main() {
test!a();
}
Result:
onlineapp.d: Error: overload alias `onlineapp.a` forward declaration
If `foo` is a function, as per the comment, I can pass `a` as an overload set
to `test()`, even though the other two functions in the set are templated.
However, since `foo` is also a template, I get an inexplicable error message.
--