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

dart runing a file that uses super params with invalid sdk constrains produces incorrect advice #48690

Closed
goderbauer opened this issue Mar 28, 2022 · 1 comment
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@goderbauer
Copy link
Contributor

dart file:

class Bar {
  Bar(this.bar);

  int bar;
}

class Foo extends Bar {
  Foo(super.bar);
}

pubspec file:

name: test

environment:
  sdk: '>=2.12.0 <3.0.0'

dart runing the dart file produces the following error:

Error: This requires the 'super-parameters' language feature to be enabled.
Try updating your pubspec.yaml to set the minimum SDK constraint to 2.15 or higher, and running 'pub get'.
  Foo(super.bar);
      ^^^^^

The SDK version number mentioned in that error is incorrect. It must be at least version 2.17 (not 2.15).

When running dart analyze, the correct version is given:

  error • lib/pure_dart.dart:8:7 • This requires the 'super-parameters' language feature to be enabled.
          Try updating your pubspec.yaml to set the minimum SDK constraint to 2.17.0 or higher, and
          running 'pub get'. • experiment_not_enabled
@goderbauer
Copy link
Contributor Author

/cc @bwilkerson @pq

@lrhn lrhn added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) area-front-end Use area-front-end for front end / CFE / kernel format related issues. labels Mar 29, 2022
@johnniwinther johnniwinther self-assigned this Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants