-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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:async should be part of dart core #26162
Comments
AFAIK the decision if something is in core or not, is not about whether it would be nice, but instead just whether it is absolutely necessary. The same for |
We have discussed this issue before, and even on the Dart team we have different opinions on it. |
If we define "absolutely necessary" as "you can't run any Dart program without it", That's similar to my reasoning here. You can create At the very least, dart:core ought to supply the types of all the things you can create with
That would make the core language self-contained. |
This has become a paint point in early Dart 2.0 - it's bad practice to write |
What's the status of this? |
+1 to @floitschG 's suggestion; export |
There is always a risk of package authors failing to update their pubspec SDK constraint when they start using a new feature. This feature in particular is going to be very easy to accidentally start relying on without realizing it and not noticing that the pubspec needs to be changed. Downstream consumers will be broken by resolving to packages they shouldn't - flutter users especially fall victim to this. We probably want either an analyzer hint or a pub validator to check this before packages are published. We'll want the analyzer or pub change to go out in the same SDK as this one. Should we consider rolling back for now until we can figure out a suitable safety net? |
Reclosing since the request for new checks is tracked in #34978 and dart-lang/pub#1981 |
I generated an application with `angel init` When running the application in a docker container, I get the error. `file:///root/.pub-cache/hosted/pub.dartlang.org/angel_configuration-2.1.0/lib/angel_configuration.dart:62:1: Error: 'Future' expects 0 type arguments.` This is due to the fact that *angel_configuration.dart* does not import 'dart:async'. This works when using the latest dart version. [see](dart-lang/sdk#26162) [see](dart-lang/sdk#34384) [see](dart-lang/sdk#34237)
The async keywords -
async
,await
,yield
, etc -are available whether you
import 'dart:async'
or not, and can even produce asyncobjects like
Future
s andStream
s:so it's a bit silly that
dart:async
isn't part of dart core.I.e. you shouldn't have to explicitly
import 'dart:async'
.The text was updated successfully, but these errors were encountered: