Skip to content

Trait 'self=>' type inheritance problem #9352

Closed
@edolgy

Description

@edolgy
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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions