Promotion by assignment seems to use a supertype of interest #60622
Labels
area-dart-model
For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.
model-flow
Implementation of flow analysis in analyzer/cfe
Consider the following program:
The flow-analysis feature specification talks about a variable being
and it requires
T
to be a type of interest for that variable. However, in this case the type of the expression isString
(which is not a type of interest fors
), and the implementation seems to use a more flexible approach wheres
is actually promoted to a type which is of interest fors
, and sound (because it's a supertype of the type of object that we just assigned to it).This might be fine (and useful!), but the specification should then be adjusted to specify this more flexible approach.
The text was updated successfully, but these errors were encountered: