Skip to content

Published packages are missing a dev.64.0 SDK constraint but not using new #1746

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
CaiJingLong opened this issue Aug 10, 2018 · 2 comments
Closed

Comments

@CaiJingLong
Copy link

flutter doctor -v
[✓] Flutter (Channel dev, v0.5.7, on Mac OS X 10.12.6 16G29, locale zh-Hans-CN)
• Flutter version 0.5.7 at /Users/cai/fluttersdk/flutter
• Framework revision 66091f9696 (4 weeks ago), 2018-07-09 12:52:41 -0700
• Engine revision 6fe748490d
• Dart version 2.0.0-dev.63.0.flutter-4c9689c1d2


I'm a flutter developer.
I use the flutter packages pub run build_runner build in cli.
The I get a error:

NoSuchMethodError: Attempted to use type 'Set' as a function. Since types do not define a method 'call', this is not possible. Did you intend to call the Set constructor and forget the 'new' operator?
Receiver: Set
Tried calling: Set()

I know that the --preview-dart-2 parameter should be added.

Where should I add this parameter to?

$ which pub
/Users/cai/fluttersdk/flutter/bin/cache/dart-sdk/bin/pub

$which dart
/Users/cai/fluttersdk/flutter/bin/cache/dart-sdk/bin/dart

$which flutter
/Users/cai/fluttersdk/flutter/bin/flutter

Or should I ask this question in flutter?

@eernstg
Copy link
Member

eernstg commented Aug 10, 2018

This would be a tool version problem: the dart vm version 2.0.0-dev.63.0 complains as described but 2.0.0-dev.64.0 supports omitting new. So when the newer versions of various tools reach Flutter, the issue should go away, and at this point you can include new as a work-around.

@natebosch natebosch changed the title Did you intend to call the Set constructor and forget the 'new' operator? Published packages are missing a dev.64.0 SDK constraint but not using new Aug 10, 2018
@natebosch
Copy link
Member

This was my mistake, when I dropped new I failed to update the minimum SDK constraint to one that had a Dart 2 VM by default, and flutter users today have a VM which is Dart 1 by default.

My plan is:

  • Cut a branch from the commit before I dropped new.
  • Update pubspecs to a +1 release from whatever versions are publish today and publish - everyone on and older SDK should resolve to these
  • Go back to master and bump minimum SDK constraints and publish a +2 for everything so that we're back to the code we expect everyone to be on where possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants