Bug in subtyping with records and FutureOr
#51731
Labels
legacy-area-front-end
Legacy: Use area-dart-model 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)
Running on tip-of-tree VM (5b3f387).
Example:
yields
There is no error on the previous lines, not even the
= nullable
one where the same value is assigned, with a different type.Changing the
42
toNull
makes no difference.Changing the other values to non-nullable makes no difference:
The argument here seems backwards, since we're assigning
int
toint?
, so maybe a type-check is reversed somewhere, or maybe just a nullability check.If I try to add:
I get an error in the first line, saying:
Again, the record type cannot be assigned to
FutureOr
of the same record type, because ... something is nullable?(And yes, it blocks my CL 😉)
The text was updated successfully, but these errors were encountered: