-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[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
Comments
@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. |
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]>
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]>
This seems out of sync with the current spec. Could you take a look? |
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]>
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]>
Ah yes, you're right. |
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]>
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]>
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]>
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]>
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]>
Marking this as done for the most part. Feature has shipped. |
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
AstBuilder
)_
in imports language#3799ResolutionVisitor
(resolve types)ScopeResolverVisitor
(resolve simple identifiers by scope)ResolverVisitor
(type-based resolution)THIS_ACCESS_FROM_FIELD_INITIALIZER
#56442private_optional_parameter
support #56381OverrideVerifier
andInheritanceOverrideVerifier
(report errors and warnings related to overrides)_
for unused parameters. 267b8efErrorVerifier
(report other errors and warnings)CONFLICTING_TYPE_VARIABLE_AND_MEMBER
#56397_
”late
wildcard variables. #55905final
wildcard variables #55920DUPLICATE_DEFINTION
reporting #56089DUPLICATE_FIELD_FORMAL_PARAMETER
reporting #56092FfiVerifier
(report errors and warnings related to FFI)UNUSED_ELEMENT
UNUSED_LOCAL_VARIABLE
UNUSED_LOCAL_VARIABLE
support #55719UNUSED_CATCH_CLAUSE
UNUSED_CATCH_CLAUSE
reporting #55723UNUSED_CATCH_STACK
UNUSED_CATCH_STACK
reporting #55721UNUSED_FIELD
UNUSED_FIELD
reporting #55862@useResult
verification should not warn on results assigned to wildcards: a86ec25The text was updated successfully, but these errors were encountered: