Closed
Description
This was thought to be #33441, but it turns out its its own issue:
const double x = 1; // inferred as 1.0
class C {
const C() : assert(x is double); // false
}
The cause for this is actually very simple. The visitor that evaluates an AST node for const evaluation, does not look at the node's staticType
at all, and simply creates an integer. This made sense when integer expressions were always integers.
It's not a bigger issue, like inference not having been run, as we thought behind #33441. It's really easy.
We have @failingTest
s for this in analyzer already.