Analyzer allows calling record with call field as a function #54651
Labels
area-dart-model
For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.
dart-model-analyzer-spec
Issues with the analyzer's implementation of the language spec
feature-records
Implementation of the records feature
P2
A bug or feature request we're likely to work on
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
(Split from #54616 since it's not expected to be due to shared code.)
Example:
Both
c(1)
andc2(1)
should be compile-time errors since their static type is not a function type,and it's not a type which has a
call
method. It has acall
getter, but that's not sufficient to allow a.call
insertion to be performed.The analyzer allows it, but then doesn't know what to do about it, so the type of the call ends up as
dynamic
.The front-end allows it and gives the return type of the function (#54616).
See: dart-lang/language#3558
The text was updated successfully, but these errors were encountered: