Skip to content

Specification defines features in terms of function-literal applications which isn't always a valid rewrite in async contexts. #25858

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
lrhn opened this issue Feb 25, 2016 · 5 comments
Labels
area-specification (deprecated) Deprecated: use area-language and a language- label. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@lrhn
Copy link
Member

lrhn commented Feb 25, 2016

Example, o?.m(a1, . . . , an, xn+1 : an+1, . . . , xn+k : an+k) is defined as equivalent to ((x) => x == null?null : x.m(a1, . . . , an, xn+1 : an+1, . . . , xn+k : an+k))(o).

This moves the expressions a1 .. an+k into a new non-async function. If the original expression is in an async function and any of these expressions contain an await, the resulting rewrite is incorrect.

The specification needs another way to introduce new expression-level bindings without resorting to function literals, perhaps let x = e1 in e2 which wouldn't change the scope.

@kmillikin
Copy link

Dart itself needs let x = e1 in e2, not just the spec :)

@lrhn
Copy link
Member Author

lrhn commented Feb 25, 2016

I completely agree, but that's #25275 :)

@anders-sandholm anders-sandholm added the area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). label Feb 25, 2016
@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed Type-Defect labels Mar 1, 2016
@munificent munificent added area-specification (deprecated) Deprecated: use area-language and a language- label. and removed area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). docs-language-spec labels Dec 13, 2016
@eernstg
Copy link
Member

eernstg commented Feb 6, 2018

No milestone now: This is independent of Dart 2. Note that several changes to the language specification have already eliminated such function literals and applications thereof. The issue still pertains to any remaining ones.

@eernstg
Copy link
Member

eernstg commented Feb 6, 2018

Note that #24508 is a special case of this issue, so it should be handled together with this one.

@lrhn
Copy link
Member Author

lrhn commented Feb 7, 2018

I believe this has been fixed. I'll close this now, and if we find that there are still cases left, we can reopen.

@lrhn lrhn closed this as completed Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-specification (deprecated) Deprecated: use area-language and a language- label. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

7 participants