| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/diag14818.d(40): Error: none of the overloads of `func` are callable using argument types `(string)` |
| 5 |
fail_compilation/diag14818.d(18): Candidates are: `diag14818.foo(int __param_0)` |
| 6 |
fail_compilation/diag14818.d(19): `diag14818.bar(double __param_0)` |
| 7 |
fail_compilation/diag14818.d(41): Error: template instance `diag14818.X!string` does not match any template declaration |
| 8 |
fail_compilation/diag14818.d(41): Candidates are: |
| 9 |
fail_compilation/diag14818.d(24): Foo(T) if (is(T == int)) |
| 10 |
fail_compilation/diag14818.d(25): Bar(T) if (is(T == double)) |
| 11 |
fail_compilation/diag14818.d(42): Error: template instance `diag14818.Y!string` does not match any template declaration |
| 12 |
fail_compilation/diag14818.d(42): Candidates are: |
| 13 |
fail_compilation/diag14818.d(25): Bar(T) if (is(T == double)) |
| 14 |
fail_compilation/diag14818.d(24): Foo(T) if (is(T == int)) |
| 15 |
--- |
| 16 |
*/ |
| 17 |
|
| 18 |
void foo(int) {} |
| 19 |
void bar(double) {} |
| 20 |
alias func = foo; |
| 21 |
alias func = bar; |
| 22 |
// in here, func is a FuncAliasDeclaration; |
| 23 |
|
| 24 |
template Foo(T) if (is(T == int)) {} |
| 25 |
template Bar(T) if (is(T == double)) {} |
| 26 |
|
| 27 |
alias X = Foo; |
| 28 |
alias X = Bar; |
| 29 |
// in here, X is an OverDeclaration |
| 30 |
|
| 31 |
template Mix1() { alias M = Foo; } |
| 32 |
template Mix2() { alias M = Bar; } |
| 33 |
mixin Mix1; |
| 34 |
mixin Mix2; |
| 35 |
alias Y = M; |
| 36 |
// in here, Y is an OverloadSet |
| 37 |
|
| 38 |
void main() |
| 39 |
{ |
| 40 |
func("abc"); |
| 41 |
alias x = X!string; |
| 42 |
alias y = Y!string; |
| 43 |
} |