[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading diagnostic when invoking nullable non-function #55488

Open
sigurdm opened this issue Apr 17, 2024 · 1 comment
Open

Misleading diagnostic when invoking nullable non-function #55488

sigurdm opened this issue Apr 17, 2024 · 1 comment
Labels
analyzer-ux area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@sigurdm
Copy link
Contributor
sigurdm commented Apr 17, 2024
import 'dart:isolate';

main() {
  Isolate.packageConfigSync();
}

Get's the following diagnostic.

image
The function can't be unconditionally invoked because it can be 'null'.
Try adding a null check ('!').dart[unchecked_use_of_nullable_value](https://dart.dev/diagnostics/unchecked_use_of_nullable_value)

The message is wrong - the nullable thing here is a Uri not a function.

Rather than complaining about the invocation of something non-nullable, I would prefer to be told first that it is not a function

@mraleph mraleph added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Apr 17, 2024
@bwilkerson bwilkerson added analyzer-ux P2 A bug or feature request we're likely to work on labels Apr 17, 2024
@bwilkerson
Copy link
Member

@scheglov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-ux area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants