Skip to content

[analyzer] Error when omitting base/final/sealed on base/final superclasses through legacy libraries. #52315

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
kallentu opened this issue May 9, 2023 · 2 comments
Assignees
Labels
dart-model-analyzer-spec Issues with the analyzer's implementation of the language spec legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on

Comments

@kallentu
Copy link
Member

kallentu commented May 9, 2023

https://github.com/dart-lang/sdk/blob/main/tests/language/class_modifiers/trans_legacy/legacy_superdeclaration_error_test.dart
Missing errors from line 46 and onwards.

The analyzer is not reporting an error when a class from a 3.0 library is a subclass of a class in a 2.19 library whose supertype is from the core libraries.

@kallentu kallentu added legacy-area-analyzer Use area-devexp instead. dart-model-analyzer-spec Issues with the analyzer's implementation of the language spec labels May 9, 2023
@kallentu kallentu self-assigned this May 9, 2023
@pq pq added the P2 A bug or feature request we're likely to work on label May 9, 2023
copybara-service bot pushed a commit that referenced this issue May 10, 2023
…l superclasses through legacy libraries.

When a post-feature library implements a pre-feature library declaration that has a final core library class as a super declaration, it should not produce a base/final/sealed transitivity error. Subclasses of a base core library class will still emit this error.

Otherwise, if base/sealed/final is omitted in a non-implement case, we want to report these errors.

Bug: #52315
Change-Id: Icdd4f63f69b061be5eabc7fd30b703d0358018a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302365
Commit-Queue: Kallen Tu <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
@kallentu
Copy link
Member Author

@sgrekhov
versioning_A03_t01.dart - checks that final class cannot be extended
versioning_A03_t04.dart - checks that mixin on a final class cannot be declared

I believe these two tests should be fixed on the analyzer side now.

@sgrekhov
Copy link
Contributor

Confirmed. Fixed. Thanx

copybara-service bot pushed a commit that referenced this issue May 22, 2023
…f a core lib declaration through a 2.19 library and a 3.0 library.

Cherry pick for the following behaviour from 3 different CLs.

Error produced when a post-feature library implements
a pre-feature library declaration that has a final/base core library class as a super declaration.

Error produced when a post-feature library subtypes (but not implements)
a pre-feature library declaration that has a final/base core library class as a super declaration.

Fixes: #52406

Bug: #52315, #52115, #52078
Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/302365
Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/301503
Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/300861
Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/301442
Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/300880
Change-Id: I2a192a157d417c1de7656aa624d3b10d9e67626e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302851
Commit-Queue: Kallen Tu <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
Reviewed-by: Johnni Winther <[email protected]>
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 legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

3 participants