[Extension types] Analyzer reports incorrect "const eval throws" for extension constructor. #53935
Labels
analyzer-constants
feature-extension-types
Implementation of the extension type feature
legacy-area-analyzer
Use area-devexp instead.
P1
A high priority bug; for example, a single project is unusable or has many test failures
P2
A bug or feature request we're likely to work on
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Example:
The CFE (VM) prints
42
as expected, with nothing throwing.The analyzer reports:
The marked position is what is shown in dartpad.dev, which is at the
v1 as num
cast ofmul
.That is the first cast to be reached in the computation, so most likely the analyzer's constant evaluator doesn't recognize that an expression with runtime value
7
and static typeNum
can be safely cast tonum
.(I use
as num
instead of._
because the former is a potentially constant expression, and the latter is not. Either should be no-ops at runtime, but only one is allowed in aconst
constructor.The text was updated successfully, but these errors were encountered: