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

#2631. Add tests checking access to local declaration named _ #2639

Merged
merged 2 commits into from
May 7, 2024

Conversation

sgrekhov
Copy link
Contributor

@sgrekhov sgrekhov commented May 6, 2024

No description provided.

@eernstg
Copy link
Member

eernstg commented May 7, 2024

Just checking, is this about wildcards? In that case it wouldn't exactly be an error to access the value of a local declaration (or class type parameter declaration) named _, the point is that no such name is added to the namespace of that scope. This makes a difference if some other declaration in scope has the name _ (say, an instance variable or a top-level declaration).

@sgrekhov
Copy link
Contributor Author

sgrekhov commented May 7, 2024

Yes, it's about wildcards. Tests for the case that you talking about now will be added later. They will cover "Wildcards don't shadow" paragraph

Copy link
Member

@eernstg eernstg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Noted a couple of typos. I also think it would be helpful to future readers to be absolutely explicit about the fact that a wildcarded declaration does not introduce anything into the current scope.

LanguageFeatures/Wildcards/binding_A01_t01.dart Outdated Show resolved Hide resolved
LanguageFeatures/Wildcards/binding_A01_t01.dart Outdated Show resolved Hide resolved
LanguageFeatures/Wildcards/binding_A01_t02.dart Outdated Show resolved Hide resolved
LanguageFeatures/Wildcards/binding_A01_t02.dart Outdated Show resolved Hide resolved
LanguageFeatures/Wildcards/binding_A01_t08.dart Outdated Show resolved Hide resolved
@sgrekhov
Copy link
Contributor Author

sgrekhov commented May 7, 2024

Thank you Updated. Please take another look

@sgrekhov sgrekhov requested a review from eernstg May 7, 2024 15:07
@eernstg
Copy link
Member

eernstg commented May 7, 2024

Thanks!

Copy link
Member

@eernstg eernstg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eernstg eernstg merged commit e861ec6 into dart-lang:master May 7, 2024
2 checks passed
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request May 13, 2024
2024-05-10 sgrekhov22@gmail.com dart-lang/co19#2641. Experimental flag renamed (dart-lang/co19#2655)
2024-05-10 sgrekhov22@gmail.com dart-lang/co19#2641. Add more test cases to the existing wildcard tests (dart-lang/co19#2654)
2024-05-10 sgrekhov22@gmail.com dart-lang/co19#2643. Remove some of 2.6 libraries, update/remove tests using them (dart-lang/co19#2650)
2024-05-08 sgrekhov22@gmail.com dart-lang/co19#2643. Remove more legacy tests from LanguageFeatures/nnbd/weak/overriding (dart-lang/co19#2648)
2024-05-08 sgrekhov22@gmail.com dart-lang/co19#2643. Remove tests checking exports from 2.6 libraries (dart-lang/co19#2651)
2024-05-08 sgrekhov22@gmail.com dart-lang/co19#2643. Remove legacy types from subtyping tests (dart-lang/co19#2652)
2024-05-08 sgrekhov22@gmail.com dart-lang/co19#2641. Add experimental flag to wildcards tests (dart-lang/co19#2653)
2024-05-07 sgrekhov22@gmail.com dart-lang/co19#2643. Remove more legacy tests from LanguageFeatures/nnbd/weak/overriding (dart-lang/co19#2647)
2024-05-07 sgrekhov22@gmail.com dart-lang/co19#2643. Remove legacy tests from LanguageFeatures/Generic-functions-as-type-args (dart-lang/co19#2645)
2024-05-07 sgrekhov22@gmail.com dart-lang/co19#2631. Add tests checking access to local declaration named `_` (dart-lang/co19#2639)
2024-05-07 sgrekhov22@gmail.com dart-lang/co19#2643. Remove legacy tests from TypeSystem/type-normalization (dart-lang/co19#2646)
2024-05-07 sgrekhov22@gmail.com dart-lang/co19#2643. Remove override checking tests in case a legacy class extending an opted-in class (dart-lang/co19#2644)
2024-05-07 sgrekhov22@gmail.com Fixes dart-lang/co19#2638. Add extension methods test for type aliases (dart-lang/co19#2640)
2024-05-07 sgrekhov22@gmail.com dart-lang/co19#2142. Add tests checking type parameter vs representation variable name conflict (dart-lang/co19#2642)
2024-05-03 devoncarew@google.com blast_repo fixes (dart-lang/co19#2637)

Change-Id: I3f9f18065b555634b621100bdc375b40a75539cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365821
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
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.

None yet

2 participants