-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestanalyzer-recoveryarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.contributions-welcomeContributions welcome to help resolve this (the resolution is expected to be clear from the issue)Contributions welcome to help resolve this (the resolution is expected to be clear from the issue)devexp-uxtype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
bool confusing(Object b) {
return b is int // Dart analyzer says: missing selector such as '.identifier' or '[0]' - line 2
&& b = 2; // error is actually here - this should be `==`.
}
void main() {}
Reproduces in dartpad and in IDE. I'd expect to only see an error on line 3 (invalid assignment). I actually see an error on line 2 (in comment), followed by a couple more confusing messages on line 3 :
error
A value of type 'int can't be returned from function 'confusing' because it has a return type of 'bool' - line 2
error
Missing selector such as '.identifier' or '[0]' - line 2
error
The operands of the '&&' operator must be assignable to 'bool' - line 3
error
A value of type 'int' can't be assigned to a variable of type 'bool' - line 3
zeppelin-tt
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestanalyzer-recoveryarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.contributions-welcomeContributions welcome to help resolve this (the resolution is expected to be clear from the issue)Contributions welcome to help resolve this (the resolution is expected to be clear from the issue)devexp-uxtype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)