Open
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
Metadata
Metadata
Assignees
Labels
A lower priority bug or feature requestFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.Contributions welcome to help resolve this (the resolution is expected to be clear from the issue)Incorrect behavior (everything from a crash to more subtle misbehavior)