The following:
----------------------------
struct Bug {
int val = 3.45;
}
int bug()
{
Bug p = Bug();
return 1;
}
static assert(bug());
-----------------------------
causes:
ice.d(4): Error: cannot implicitly convert expression (3.45) of type double to int
CTFE: ErrorExp in ice.d(6)
assert interpret.c(310) 0
This is an error propagation bug that the CTFE AST validator is detecting.
The "implicit conversion" error message occurs when running semantic on Bug().
Later on, when compiling bug(), no new error message is generated, even though it uses the ErrorExp from the default initializer of Bug(). So, bug() isn't marked as containing an error.
Comment #3 by github-bugzilla — 2013-07-12T11:44:35Z