Skip to content

Bindings in structural self types are not picked up correctly. #5279

Closed
@odersky

Description

@odersky

The following typechecks:

trait TS { type T = Int }
trait T { self: TS =>
  type T
  def lift(x: Int): T = x
}

But this variant doesn't:

trait T { self: { type T = Int } =>
  type T
  def lift(x: Int): T = x  // error: expected T, found: Int
}

The two should behave the same.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions