Skip to content

call to inline method on super trait fails #17584

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
nicolasstucki opened this issue May 25, 2023 · 1 comment · Fixed by #17598
Closed

call to inline method on super trait fails #17584

nicolasstucki opened this issue May 25, 2023 · 1 comment · Fixed by #17598

Comments

@nicolasstucki
Copy link
Contributor

Compiler version

3.3.0-RC4

Minimized code

trait A:
  inline def g = 1
trait B extends A:
  def f = super.g
class C extends B

Output

5 |class C extends B
  |      ^
  |Member method g of mixin trait B is missing a concrete super implementation in class C.

Expectation

Should compile

@odersky
Copy link
Contributor

odersky commented May 26, 2023

The problem is detected just before erasure in ResolveSuper where super accessors are resolved. g in trait A does not generate code, so there's nothing to resolve.

Maybe we could avoid the super accessor if the call goes to an inline method? Inline methods cannot be overridden, so the super accessor is not needed, it seems.

odersky added a commit to dotty-staging/dotty that referenced this issue May 26, 2023
Inline methods cannot be overridden, so they don't need super accessors.

Fixes scala#17584
nicolasstucki added a commit that referenced this issue Jun 6, 2023
Inline methods cannot be overridden, so they don't need super accessors.

Fixes #17584
@Kordyjan Kordyjan added this to the 3.4.0 milestone Aug 1, 2023
Kordyjan pushed a commit that referenced this issue Nov 17, 2023
Inline methods cannot be overridden, so they don't need super accessors.

Fixes #17584

[Cherry-picked 467edd8]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants