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

Correct grammar rule for <typeNotVoidNotFunction> to allow prefix #3492

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

eernstg
Copy link
Member

@eernstg eernstg commented Dec 4, 2023

Thanks to @modulovalue for reporting this grammar fault!

It is possible to import 'dart:core' with a prefix p. This causes the built-in class Function to be denoted by the term p.Function (whereas the plain identifier Function is a lookup failure, or it denotes something else, or it actually works because we're also explicitly importing 'dart:core' without a prefix).

In any case, we should allow p.Function in the grammar. This PR changes said grammar rule such that this is achieved.

@eernstg eernstg merged commit b44b0f4 into main Dec 4, 2023
4 checks passed
@eernstg eernstg deleted the specify_fix_54218_dec23 branch December 4, 2023 17:51
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Dec 5, 2023
This CL changes the specification grammar Dart.g such that it allows
using `p.Function` to denote the built-in type `Function`. This is
necessary in the case where 'dart:core' has been imported with an
import prefix `p` (and it hasn't been imported without a prefix at the
same time). The corresponding spec update is in
dart-lang/language#3492.

Change-Id: Iaaba1c3bc8f5d3a8700c8e62ec3a1af92334840b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339561
Reviewed-by: Chloe Stefantsova <[email protected]>
Commit-Queue: Erik Ernst <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants