| 1 |
/* |
| 2 |
EXTRA_FILES: imports/constraints.d |
| 3 |
TEST_OUTPUT: |
| 4 |
---- |
| 5 |
fail_compilation/constraints_func3.d(53): Error: none of the overloads of template `imports.constraints.overload` are callable using argument types `!()(int)` |
| 6 |
fail_compilation/imports/constraints.d(39): Candidates are: `overload(T)(T v)` |
| 7 |
with `T = int` |
| 8 |
must satisfy the following constraint: |
| 9 |
` N!T` |
| 10 |
fail_compilation/imports/constraints.d(40): `overload(T)(T v)` |
| 11 |
with `T = int` |
| 12 |
must satisfy the following constraint: |
| 13 |
` !P!T` |
| 14 |
fail_compilation/imports/constraints.d(41): `overload(T)(T v1, T v2)` |
| 15 |
fail_compilation/imports/constraints.d(42): `overload(T, V)(T v1, V v2)` |
| 16 |
fail_compilation/constraints_func3.d(54): Error: none of the overloads of template `imports.constraints.overload` are callable using argument types `!()(int, string)` |
| 17 |
fail_compilation/imports/constraints.d(39): Candidates are: `overload(T)(T v)` |
| 18 |
fail_compilation/imports/constraints.d(40): `overload(T)(T v)` |
| 19 |
fail_compilation/imports/constraints.d(41): `overload(T)(T v1, T v2)` |
| 20 |
fail_compilation/imports/constraints.d(42): `overload(T, V)(T v1, V v2)` |
| 21 |
with `T = int, |
| 22 |
V = string` |
| 23 |
must satisfy one of the following constraints: |
| 24 |
` N!T |
| 25 |
N!V` |
| 26 |
fail_compilation/constraints_func3.d(56): Error: template `variadic` is not callable using argument types `!()()` |
| 27 |
fail_compilation/imports/constraints.d(43): Candidate is: `variadic(A, T...)(A a, T v)` |
| 28 |
fail_compilation/constraints_func3.d(57): Error: template `variadic` is not callable using argument types `!()(int)` |
| 29 |
fail_compilation/imports/constraints.d(43): Candidate is: `variadic(A, T...)(A a, T v)` |
| 30 |
with `A = int, |
| 31 |
T = ()` |
| 32 |
must satisfy the following constraint: |
| 33 |
` N!int` |
| 34 |
fail_compilation/constraints_func3.d(58): Error: template `variadic` is not callable using argument types `!()(int, int)` |
| 35 |
fail_compilation/imports/constraints.d(43): Candidate is: `variadic(A, T...)(A a, T v)` |
| 36 |
with `A = int, |
| 37 |
T = (int)` |
| 38 |
must satisfy the following constraint: |
| 39 |
` N!int` |
| 40 |
fail_compilation/constraints_func3.d(59): Error: template `variadic` is not callable using argument types `!()(int, int, int)` |
| 41 |
fail_compilation/imports/constraints.d(43): Candidate is: `variadic(A, T...)(A a, T v)` |
| 42 |
with `A = int, |
| 43 |
T = (int, int)` |
| 44 |
must satisfy the following constraint: |
| 45 |
` N!int` |
| 46 |
---- |
| 47 |
*/ |
| 48 |
|
| 49 |
void main() |
| 50 |
{ |
| 51 |
import imports.constraints; |
| 52 |
|
| 53 |
overload(0); |
| 54 |
overload(0, ""); |
| 55 |
|
| 56 |
variadic(); |
| 57 |
variadic(0); |
| 58 |
variadic(0, 1); |
| 59 |
variadic(0, 1, 2); |
| 60 |
} |