| 1 |
// https://issues.dlang.org/show_bug.cgi?id=10273 |
| 2 |
// ICE in CTFE |
| 3 |
/* |
| 4 |
TEST_OUTPUT: |
| 5 |
--- |
| 6 |
fail_compilation/ice10273.d(14): Error: cannot implicitly convert expression `3.45` of type `double` to `int` |
| 7 |
fail_compilation/ice10273.d(13): Error: CTFE failed because of previous errors in `Bug10273.init` |
| 8 |
fail_compilation/ice10273.d(22): called from here: `bug10273()` |
| 9 |
fail_compilation/ice10273.d(22): while evaluating: `static assert(bug10273())` |
| 10 |
--- |
| 11 |
*/ |
| 12 |
|
| 13 |
struct Bug10273 { |
| 14 |
int val = 3.45; |
| 15 |
} |
| 16 |
int bug10273() |
| 17 |
{ |
| 18 |
Bug10273 p; |
| 19 |
return 1; |
| 20 |
} |
| 21 |
|
| 22 |
static assert(bug10273()); |