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

Fuzzy arrow / dynamic as bottom is a hint, but should be a warning #31874

Closed
mit-mit opened this issue Jan 12, 2018 · 7 comments
Closed

Fuzzy arrow / dynamic as bottom is a hint, but should be a warning #31874

mit-mit opened this issue Jan 12, 2018 · 7 comments
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. customer-dart-2

Comments

@mit-mit
Copy link
Member

mit-mit commented Jan 12, 2018

We stumbled over the grpc-dart repo not passing uses_dynamic_as_bottom by coincidence despite that repo running analysis on travis. The issue is that we currently report this as just a hint, which doesn't fail the build:

$ dartanalyzer lib test
Analyzing lib, test...
  hint • A function of type '(Socket) → void' can't be assigned to a variable of type '(dynamic) → FutureOr<void>' at lib/src/client/connection.dart:108:22 • uses_dynamic_as_bottom

Shouldn't this at least be a warning?

@mit-mit
Copy link
Member Author

mit-mit commented Jan 12, 2018

cc @leafpetersen

@vsmenon
Copy link
Member

vsmenon commented Jan 12, 2018

This will eventually become an error. Not sure it's worth making it a warning as an intermediate step.

@leafpetersen
Copy link
Member

It might be worth making this a warning, if we can do so without breaking the internal builds (we're currently working on eliminating the hint internally). Making it a warning earlier might help us avoid accidental regressions. I'll look into it.

In the meantime if you want to protect against this, you can put the following in your analysis options file:

analyzer:
  errors:
    uses_dynamic_as_bottom: warning

@leafpetersen
Copy link
Member

@srawlins if we promoted this from hint to warning, could we keep it from breaking builds internally?

@srawlins
Copy link
Member

It won't break anything internally.

@vsmenon vsmenon added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Jan 16, 2018
@leafpetersen
Copy link
Member

I have a CL for this, but have to land a CL making our tests clean first. Mostly done, hoping to land today.

@leafpetersen
Copy link
Member

@whesse whesse closed this as completed in fff71ee Jan 17, 2018
@mit-mit mit-mit added this to the 2.0-alpha1 milestone Jan 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. customer-dart-2
Projects
None yet
Development

No branches or pull requests

4 participants