Skip to content

[Wildcard Variables] Analyzer Implementation #55680

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
36 of 42 tasks
Tracked by #55673
kallentu opened this issue May 9, 2024 · 4 comments
Closed
36 of 42 tasks
Tracked by #55673

[Wildcard Variables] Analyzer Implementation #55680

kallentu opened this issue May 9, 2024 · 4 comments
Assignees
Labels
dart-model-analyzer-spec Issues with the analyzer's implementation of the language spec feature-wildcard-variables Implementation of the wildcard variables feature legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@kallentu
Copy link
Member

kallentu commented May 9, 2024

This meta issue tracks all the analyzer implementation work items. Referenced from: https://github.com/dart-lang/sdk/blob/main/pkg/analyzer/doc/process/new_language_feature.md

Work Items

@kallentu kallentu added legacy-area-analyzer Use area-devexp instead. area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). and removed area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). labels May 9, 2024
@srawlins srawlins added type-enhancement A request for a change that isn't a bug P2 A bug or feature request we're likely to work on labels May 10, 2024
@kallentu
Copy link
Member Author

@pq I updated what needs to be done in the analyzer with a short note from the kickoff. If it's easier to track with singular issues, we can do that too.

I suspect this work can start soon. I'm currently slowly adding language tests to the repo and I usually use those as a good indicator of what's working and what isn't.

@pq pq added the feature-wildcard-variables Implementation of the wildcard variables feature label May 14, 2024
copybara-service bot pushed a commit that referenced this issue Jun 3, 2024
See: #55680

Change-Id: Ib65be42206c6bd66ddaaf54224490870acf4a2bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368941
Auto-Submit: Phil Quitslund <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Phil Quitslund <[email protected]>
copybara-service bot pushed a commit that referenced this issue Jun 11, 2024
Update wildcard variable scopes.

See:  #55862 and #55680.

See discussion on related/ updated co19 test (`co19/LanguageFeatures/Wildcards/wildcards_do_not_shadow_A01_t04`) here: dart-lang/co19#2698.





Change-Id: I388895ef7bac69617700504a964ce9f3021b2d24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368526
Commit-Queue: Phil Quitslund <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
@pq
Copy link
Member

pq commented Jul 15, 2024

@kallentu:

From #super-parameters, “An occurrence of super._ as a declaration of a formal parameter in a constructor is a compile-time error.”

This seems out of sync with the current spec. Could you take a look?

copybara-service bot pushed a commit that referenced this issue Jul 15, 2024
See: #55680

Change-Id: I7893a5e9b2ff91d50eb1a997206f958705f81e14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375721
Commit-Queue: Phil Quitslund <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
copybara-service bot pushed a commit that referenced this issue Jul 16, 2024
See: #55680

Change-Id: I74e41257e1537ce371d10d4bb7aa24afbb911b6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376024
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Phil Quitslund <[email protected]>
@srawlins srawlins added the dart-model-analyzer-spec Issues with the analyzer's implementation of the language spec label Jul 19, 2024
@kallentu
Copy link
Member Author

@kallentu:

From #super-parameters, “An occurrence of super._ as a declaration of a formal parameter in a constructor is a compile-time error.”

This seems out of sync with the current spec. Could you take a look?

Ah yes, you're right.
I updated the task, feel free to remove it or change it. super._ isn't a compile time error.

copybara-service bot pushed a commit that referenced this issue Aug 8, 2024
Addresses a bunch of INVALID_ASSIGNMENT errors reported in the language and co19 tests.

CompileTimeError -> Pass (expected Pass)
language/wildcard_variables/non_binding/class_members_test
language/wildcard_variables/non_binding/top_level_function_test
language/wildcard_variables/non_binding/top_level_variable_test

MissingCompileTimeError -> Pass (expected Pass)
co19/LanguageFeatures/Wildcards/binding_A01_t08
co19/LanguageFeatures/Wildcards/binding_A01_t09

See: #55680

Change-Id: Ide4c3f3729a91d478be7a7e46477164e17703435
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379442
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Phil Quitslund <[email protected]>
copybara-service bot pushed a commit that referenced this issue Aug 9, 2024
Fixes:

language/wildcard_variables/initializing_formal_parameters/super_test
co19/LanguageFeatures/Wildcards/super_parameters_A04_t01

See: #55680

Change-Id: I7223da0df0f66fcc7b5737af686e34aa387c5c92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379721
Commit-Queue: Phil Quitslund <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
copybara-service bot pushed a commit that referenced this issue Aug 12, 2024
See: #55680

Fixes:

MissingCompileTimeError -> Pass (expected Pass)
co19/LanguageFeatures/Wildcards/binding_A01_t02
co19/LanguageFeatures/Wildcards/initializing_formals_A02_t01
co19/LanguageFeatures/Wildcards/initializing_formals_A02_t03

MissingCompileTimeError -> Pass (expected Pass)
language/wildcard_variables/initializing_formal_parameters/this_initializer_access_error_test

Change-Id: I7c14757e312e7f426290ed63ed745eac4856bab3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380160
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Phil Quitslund <[email protected]>
copybara-service bot pushed a commit that referenced this issue Aug 15, 2024
Fixes:

CompileTimeError -> Pass (expected Pass)
co19/LanguageFeatures/Wildcards/binding_A02_t08

See: #55680

Change-Id: I5fffc47b52a2fa5d86e6be0b8a780bc3abcff1c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380206
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Phil Quitslund <[email protected]>
copybara-service bot pushed a commit that referenced this issue Aug 16, 2024
Fixes `co19/src/LanguageFeatures/Wildcards/super_parameters_A04_t02.dart`

```
class A {
  final int x, y;
  A(this.x, [this.y = 0]);
}

class C extends A {
  final int _;
  String log = "";
  C(this._, super._, [super._]) {
    log = "_=$_, x=$x, y=$y";
  }
  C.n(this._, super._, [super._ = 1]) {
    log = "_=$_, x=$x, y=$y";
  }
}

main() {
  Expect.equals("_=1, x=2, y=3", C(1, 2, 3).log);
  Expect.equals("_=1, x=2, y=0", C(1, 2).log);
  Expect.equals("_=1, x=2, y=1", C.n(1, 2).log);
}
```

See: #55680



Change-Id: Ia87ae6a73816a08ca83d77c7f077e9ed7c153ebb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380883
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Phil Quitslund <[email protected]>
@kallentu
Copy link
Member Author

Marking this as done for the most part. Feature has shipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dart-model-analyzer-spec Issues with the analyzer's implementation of the language spec feature-wildcard-variables Implementation of the wildcard variables feature legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants