Skip to content

Trait 'self=>' type inheritance problem #9352

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
edolgy opened this issue Jul 12, 2020 · 1 comment · Fixed by #10982
Closed

Trait 'self=>' type inheritance problem #9352

edolgy opened this issue Jul 12, 2020 · 1 comment · Fixed by #10982
Assignees
Milestone

Comments

@edolgy
Copy link

edolgy commented Jul 12, 2020

abstract class Foo[A] extends Bar[A]

trait Bar[A]:
  self: Foo[A] =>
  def foo             : Unit   = bar(null)
  def bar(f: Type[A]) : Unit

trait Type[A]

Ambiguous overload. The overloaded alternatives of method bar in trait Bar with types
[error] (f: Type[A]): Unit
[error] (f: Type[A]): Unit
[error] both match arguments (Null)
[error] def foo : Unit = bar(null)

PS. Couple of months ago this would compile with no problem

@griggt
Copy link
Contributor

griggt commented Nov 3, 2020

#9063 (dbc1e95) caused the regression.

odersky added a commit to dotty-staging/dotty that referenced this issue Jan 3, 2021
@odersky odersky assigned odersky and unassigned smarter Jan 3, 2021
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
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.

5 participants