| 1 |
/* |
| 2 |
REQUIRED_ARGS: -preview=in |
| 3 |
TEST_OUTPUT: |
| 4 |
--- |
| 5 |
fail_compilation/diagin.d(15): Error: function `foo` is not callable using argument types `()` |
| 6 |
fail_compilation/diagin.d(15): too few arguments, expected 1, got 0 |
| 7 |
fail_compilation/diagin.d(20): `diagin.foo(in int)` declared here |
| 8 |
fail_compilation/diagin.d(17): Error: template `foo1` is not callable using argument types `!()(bool[])` |
| 9 |
fail_compilation/diagin.d(21): Candidate is: `foo1(T)(in T v, string)` |
| 10 |
--- |
| 11 |
*/ |
| 12 |
|
| 13 |
void main () |
| 14 |
{ |
| 15 |
foo(); |
| 16 |
bool[] lvalue; |
| 17 |
foo1(lvalue); |
| 18 |
} |
| 19 |
|
| 20 |
void foo(in int) {} |
| 21 |
void foo1(T)(in T v, string) {} |
| 22 |
|
| 23 |
// Ensure that `in` has a unique mangling |
| 24 |
static assert(foo.mangleof == `_D6diagin3fooFIiZv`); |
| 25 |
static assert(foo1!int.mangleof == `_D6diagin__T4foo1TiZQiFNaNbNiNfIiAyaZv`); |
| 26 |
static assert(foo1!char.mangleof == `_D6diagin__T4foo1TaZQiFNaNbNiNfIaAyaZv`); |