Skip to content

Analyzer/CFE inconsistency on super calls to abstract methods. #33662

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
leafpetersen opened this issue Jun 27, 2018 · 6 comments
Closed

Analyzer/CFE inconsistency on super calls to abstract methods. #33662

leafpetersen opened this issue Jun 27, 2018 · 6 comments
Assignees
Labels
legacy-area-analyzer Use area-devexp instead. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Milestone

Comments

@leafpetersen
Copy link
Member

Consider this code:

abstract class Foo {
  String get attribute;
}

abstract class Bar implements Foo {
}

class Baz extends Bar {
  String get attribute => super.attribute;
}

void main() {
  new Baz();
}

When run with the CFE, this produces the following:

tmp/ddctest.dart:14:33: Error: Superclass has no getter named 'attribute'.
  String get attribute => super.attribute;
                                ^^^^^^^^^

When run through the analyzer, it produces the following:

  hint • The getter 'attribute' is always abstract in the supertype at tmp/ddctest.dart:14:33 • abstract_super_member_reference
1 hint found.

I believe that this should be an error on all platforms.

cc @lrhn do you agree that this is an error or am I missing something?

cc @kmillikin, @bwilkerson

@leafpetersen leafpetersen added the area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). label Jun 27, 2018
@leafpetersen leafpetersen self-assigned this Jun 27, 2018
@leafpetersen
Copy link
Member Author

cc @keertip

@rich-j
Copy link

rich-j commented Jun 28, 2018

Is this issue related to #33420?

@lrhn
Copy link
Member

lrhn commented Jun 28, 2018

Agree that it's an error in Dart 2.
All super-invocations must target specific actual methods and call them in a valid way.

@leafpetersen leafpetersen removed their assignment Jun 28, 2018
@leafpetersen leafpetersen added legacy-area-analyzer Use area-devexp instead. and removed area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Jun 28, 2018
@leafpetersen
Copy link
Member Author

Ok, moving this over to an analyzer bug.

@leafpetersen
Copy link
Member Author

File a spec issue to ensure the text reflects this: #33963 .

@bwilkerson bwilkerson added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Aug 27, 2018
@scheglov scheglov self-assigned this Sep 11, 2018
dart-bot pushed a commit that referenced this issue Sep 11, 2018
There is no distinction between them from the langauge of view anymore.

This is a preparatory step before reporting super-invoked abstract
class members as errors, which we should do according to the issue.

Which, in turn, is for consistency between repoting corresponding
error for super-invoked, but not concrete members in mixin applications.

[email protected]

Bug: #33662
Change-Id: I00e8f185dbbdd1ffac88c500394a1e1497be6f9a
Reviewed-on: https://dart-review.googlesource.com/74481
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
@scheglov
Copy link
Contributor

dart-bot pushed a commit that referenced this issue Sep 12, 2018
[email protected]

Bug: #33662
Change-Id: Ic80386c20acd2cd1ceebeb90fbb1d6e18982b024
Reviewed-on: https://dart-review.googlesource.com/74499
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-area-analyzer Use area-devexp instead. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

6 participants