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

Invocation of super.abstractMethod() is not resolved. #31593

Closed
scheglov opened this issue Dec 8, 2017 · 3 comments
Closed

Invocation of super.abstractMethod() is not resolved. #31593

scheglov opened this issue Dec 8, 2017 · 3 comments
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. customer-analyzer front-end-kernel P2 A bug or feature request we're likely to work on

Comments

@scheglov
Copy link
Contributor

scheglov commented Dec 8, 2017

Here is an edge case test in Analyzer.

abstract class A {
  int m();
  noSuchMethod(_) => 42;
}

class B extends A {
  int m() => super.m();
}

It reports no static errors, because A has noSuchMethod().

But FrontEnd also does not provide resolution for super.m(), which is bad for Analyzer - we want users to know that it resolves to A.m(), so that semantic highlighting and search work.

@lrhn
Copy link
Member

lrhn commented Dec 9, 2017

I would make this a compile-time error. There is no m implementation in the superclass of B. Calling super.m() is a compile-time error because it refers statically to a member which isn't there.

That's not the same as a interface invocation (new A().m() is valid because the interface of A has a member m, but A.staticM() is not because the class A has not static member staticM). A super-invocation is a static invocation, and it's either safe or a compile-time error.

@scheglov
Copy link
Contributor Author

https://dart-review.googlesource.com/#/c/sdk/+/28120 makes it hint even if there is noSuchMethod(). Making it an error with the new front-end sounds good to me.

whesse pushed a commit that referenced this issue Jan 4, 2018
…s has noSuchMethod().

See the bug.
This does not make it a compile time error though.

R=brianwilkerson@google.com

Bug: #31593
Change-Id: Iefef8eecec43b6b8afaac74198bffbeae1c8b104
Reviewed-on: https://dart-review.googlesource.com/28120
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
@jensjoha jensjoha added the P2 A bug or feature request we're likely to work on label Jan 8, 2018
@askeksa-google
Copy link

The example gives an error from CFE now.

@kmillikin kmillikin added area-front-end Use area-front-end for front end / CFE / kernel format related issues. front-end-kernel and removed area-front-end Use area-front-end for front end / CFE / kernel format related issues. labels Sep 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. customer-analyzer front-end-kernel P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

6 participants