Skip to content

Analyzer 0.33.3 has improper min SDK constraint #35158

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

Closed
jakemac53 opened this issue Nov 13, 2018 · 3 comments
Closed

Analyzer 0.33.3 has improper min SDK constraint #35158

jakemac53 opened this issue Nov 13, 2018 · 3 comments
Assignees
Labels
dart-model-analyzer-package Issues related to package:analyzer legacy-area-analyzer Use area-devexp instead. P1 A high priority bug; for example, a single project is unusable or has many test failures

Comments

@jakemac53
Copy link
Contributor

The latest analyzer doesn't import dart:async but references Future, which is only valid as of 2.1.0-dev.5.0, but the stated min SDK is 2.0.0-dev.48.0.

This results in the following static error for all users between that sdk and 2.1.0-dev.5.0:

file:///.../analyzer-0.33.3/lib/src/dart/analysis/results.dart:180:10: Error: Expected 0 type arguments.
  static Future<ResolvedLibraryResult> tmp(LibraryElement library) async {
         ^
file:///.../analyzer-0.33.3/lib/src/dart/analysis/results.dart:198:12: Error: A value of type '#lib1::ResolvedLibraryResultImpl' can't be assigned to a variable of type 'dart.async::FutureOr<invalid-type>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::FutureOr<invalid-type>'.
    return ResolvedLibraryResultImpl(null, libraryPath, library.source.uri,
           ^
file:///...analyzer-0.33.3/lib/src/dart/analysis/results.dart:180:40: Error: Functions marked 'async' must have a return type assignable to 'Future'.
  static Future<ResolvedLibraryResult> tmp(LibraryElement library) async 

The best fix would be to publish a +1 release which adds the dart:async import, but no minimum SDK change, and then immediately re-release the current version with an additional +1 but change the minimum SDK constraint to 2.1.0-dev.5.0.

@jakemac53 jakemac53 added P1 A high priority bug; for example, a single project is unusable or has many test failures legacy-area-analyzer Use area-devexp instead. dart-model-analyzer-package Issues related to package:analyzer labels Nov 13, 2018
@stereotype441 stereotype441 self-assigned this Nov 14, 2018
@stereotype441
Copy link
Member

Published analyzer 0.33.3+1 which adds the dart:async import, but no minimum SDK change. Now preparing a +2 release.

@jakemac53
Copy link
Contributor Author

Thanks Paul!

@stereotype441
Copy link
Member

Published analyzer 0.33.3+2 which is identical to 0.33.3 but with a minimum SDK constraint of 2.1.0-dev.5.0.

dart-bot pushed a commit that referenced this issue Nov 14, 2018
These changes were made in order to fix #35158.  We want them on the
analyzer branch too so that they will be retained when analyzer
version 0.34.0 is published.

Change-Id: I45cfb70e87735ba5c62b11fa1b161704217f70cc
Reviewed-on: https://dart-review.googlesource.com/c/84445
Commit-Queue: Paul Berry <[email protected]>
Auto-Submit: Paul Berry <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
dart-bot pushed a commit that referenced this issue Nov 27, 2018
This CL causes the anaylzer to require an SDK version of at least
2.1.0-dev.5.0, which was the first version of the SDK in which
dart:core exported Future.

This change was already applied to the analyzer and analyzer-0.33
branches; this CL merely applies it to the master branch as well.  See
#35158.

Change-Id: I74ba071c5a2244a7ffa3d7ecadcfc9b2d7fbcf3f
Reviewed-on: https://dart-review.googlesource.com/c/85413
Commit-Queue: Paul Berry <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
Auto-Submit: Paul Berry <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dart-model-analyzer-package Issues related to package:analyzer legacy-area-analyzer Use area-devexp instead. P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

2 participants