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

Keyword collision while trying to send async requests inside async call #37063

Closed
ghost opened this issue May 23, 2019 · 1 comment
Closed

Keyword collision while trying to send async requests inside async call #37063

ghost opened this issue May 23, 2019 · 1 comment
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. 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

@ghost
Copy link

ghost commented May 23, 2019

import 'dart:html' as html;

void main() async {
  var request = new html.HttpRequest();
  request.open('POST', 'http://example.com', async: true);
}

Displays:
async

Dart VM version: 2.3.0

@lrhn lrhn added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. 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) labels May 23, 2019
@lrhn
Copy link
Member

lrhn commented May 23, 2019

That is a bug.
The specification says:

It is a compile-time error if either of the identifiers \AWAIT{} or \YIELD{} is used as an identifier in a function body marked with either \ASYNC{}, \code{\ASYNC*} or \code{\SYNC*}.

That makes await and yield context-dependent keywords. They are keywords, but only inside async, async* or sync* methods. That choice was made because we needed the keywords, but did not want to break existing code that already uses the words.
The section used to also make async reserved, but that was changed for Dart 2.0 (it wasn't necessary).

Seems like the our tools haven't removed async them from the reserved list yet.

@lrhn lrhn self-assigned this May 23, 2019
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. 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

1 participant