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

[analyzer][Class modifiers] No error if base class is indirectly implemented #52056

Closed
sgrekhov opened this issue Apr 17, 2023 · 6 comments
Closed
Assignees
Labels
analyzer-spec Issues with the analyzer's implementation of the language spec area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Milestone

Comments

@sgrekhov
Copy link
Contributor

The following co19 tests fail in both analyzer and CFE
https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Class-modifiers/basic_restrictions_A03_t08.dart
https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Class-modifiers/basic_restrictions_A03_t09.dart
https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Class-modifiers/basic_restrictions_A03_t10.dart

The code looks like

// class_modifiers_lib.dart
base class BaseClass {}

// test.dart
import "class_modifiers_lib.dart";

base class ExtendsBaseClass extends BaseClass {}

base class IndirectlyImplementsBaseClass implements ExtendsBaseClass {}
//                                                  ^^^^^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

No expected errors produced. But according to the spec

It's a compile-time error if:
...
A declaration implements another declaration, and the other declaration itself, or any of its super-declarations, are marked base or final and are not from the first declaration's library

Tested on the edge SDK (April 17, 2023) on Linux x64

@eernstg eernstg added area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Apr 17, 2023
@eernstg
Copy link
Member

eernstg commented Apr 17, 2023

If this is handled by _fe_analyzer_shared then 'area-meta' may be actionable. If it is handled separately by the common front end and the analyzer then we should have a sub-issue for each of those tools.

@johnniwinther, @stereotype441, WDYT?

@eernstg
Copy link
Member

eernstg commented Apr 17, 2023

@kallentu, maybe you're the one who knows best?

@stereotype441
Copy link
Member

@eernstg FYI, I recently created an area-fe-analyzer-shared label for issues affecting the shared code. I'll apply that label to this issue now. (@kallentu I don't actually know if you implemented this logic in a shared way or not; feel free to adjust the labels as appropriate).

@stereotype441 stereotype441 added area-fe-analyzer-shared Assigned by engineers; when triaging, prefer either area-front-end or area-analyzer. and removed area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). labels Apr 17, 2023
@kallentu kallentu added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. area-front-end Use area-front-end for front end / CFE / kernel format related issues. and removed area-fe-analyzer-shared Assigned by engineers; when triaging, prefer either area-front-end or area-analyzer. labels Apr 17, 2023
@kallentu
Copy link
Member

It's not shared code, but I just used the front end and analyzer labels. I'm okay if we want to split the issue or keep as is.
I'll look into the issue.

@eernstg
Copy link
Member

eernstg commented Apr 18, 2023

Sounds good! We'd have two-or-more issues in the case where a given implementation effort takes place in two-or-more different portions of source code, because it's difficult to determine the right time to close the issue if one job is done and another is not. I guess that's not important in this case.

@kallentu kallentu self-assigned this Apr 20, 2023
@kallentu kallentu changed the title [Class modifiers] No error if base class is indirectly implemented [analyzer][Class modifiers] No error if base class is indirectly implemented Apr 20, 2023
@kallentu kallentu removed the area-front-end Use area-front-end for front end / CFE / kernel format related issues. label Apr 20, 2023
@srawlins srawlins added P2 A bug or feature request we're likely to work on analyzer-spec Issues with the analyzer's implementation of the language spec labels Apr 24, 2023
@leafpetersen leafpetersen added this to the Dart 3 stable milestone Apr 25, 2023
@scheglov scheglov added P1 A high priority bug; for example, a single project is unusable or has many test failures and removed P2 A bug or feature request we're likely to work on labels Apr 25, 2023
@scheglov scheglov self-assigned this Apr 28, 2023
@scheglov
Copy link
Contributor

Was fixed as #52160.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-spec Issues with the analyzer's implementation of the language spec area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

7 participants