[extension type] Analyzer has incorrect constant identity for type literals of nested extension types. #54057
Labels
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
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Example:
Analyzing this with a freshly built analyzer (updated some time today) gives the following errors:
The error seems to only occur when there are extension types nested inside composite extension types.
(I have a bigger test combining this with things like
T?
,FutureOr<T>
and function types. Seems to be consistent, but hard to say exactly.)The identity is consistent, if I check
const Chk(ExList<ExInt>, id: ExList<ExInt>);
, it gives no error,same if I try to put two types that are considered distinct into the same constant set.
The error message doesn't say what the actual
Type
objects are, just that they're not identical to to the expected constant type literal. Which is reasonable, theassert
just saw afalse
value, it didn't know why. (Also doesn't look at the message.)(Haven't found a way to make the analyzer print constant
Type
objects. If I add"${(object, id: id)}"
as a message to the assert, the CFE compiler helpfully shows a useful "toString" of theType
object that it won't allow me to convert to a string.)The text was updated successfully, but these errors were encountered: