| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
---- |
| 4 |
fail_compilation/fail322.d(15): Error: function `digestToString2` is not callable using argument types `(string)` |
| 5 |
fail_compilation/fail322.d(15): cannot pass rvalue argument `"1234567890123456"` of type `string` to parameter `ref char[16] digest` |
| 6 |
fail_compilation/fail322.d(20): `fail322.digestToString2(ref char[16] digest)` declared here |
| 7 |
fail_compilation/fail322.d(17): Error: function `digestToString2` is not callable using argument types `(const(char[16]))` |
| 8 |
fail_compilation/fail322.d(17): cannot pass argument `s` of type `const(char[16])` to parameter `ref char[16] digest` |
| 9 |
fail_compilation/fail322.d(20): `fail322.digestToString2(ref char[16] digest)` declared here |
| 10 |
---- |
| 11 |
*/ |
| 12 |
|
| 13 |
void main() |
| 14 |
{ |
| 15 |
digestToString2("1234567890123456"); |
| 16 |
const char[16] s; |
| 17 |
digestToString2(s); |
| 18 |
} |
| 19 |
|
| 20 |
void digestToString2(ref char[16] digest) |
| 21 |
{ |
| 22 |
assert(digest[0] == 0xc3); |
| 23 |
assert(digest[15] == 0x3b); |
| 24 |
} |