| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/ctfe14207.d(13): Error: cannot convert `&immutable(ulong)` to `ubyte[8]*` at compile time |
| 5 |
fail_compilation/ctfe14207.d(18): called from here: `nativeToBigEndian()` |
| 6 |
fail_compilation/ctfe14207.d(22): called from here: `digest()` |
| 7 |
--- |
| 8 |
*/ |
| 9 |
|
| 10 |
ubyte[8] nativeToBigEndian() |
| 11 |
{ |
| 12 |
immutable ulong res = 1; |
| 13 |
return *cast(ubyte[8]*) &res; |
| 14 |
} |
| 15 |
|
| 16 |
auto digest() |
| 17 |
{ |
| 18 |
ubyte[8] bits = nativeToBigEndian(); |
| 19 |
return bits; |
| 20 |
} |
| 21 |
|
| 22 |
enum h = digest(); |