Skip to content

Reference to type parameter name is ambiguous with inner trait and self-type to outer trait #9844

Closed
@Sciss

Description

@Sciss

Minimized code

object DetSkipOctree {
  sealed trait Leaf  [PL]
  sealed trait Branch[PL]
} 
trait DetSkipOctree[PL]

class Impl[PL] extends DetSkipOctree[PL] {
  final type Leaf = DetSkipOctree.Leaf[PL]
  
  protected trait LeftBranchImpl {
    this: DetSkipOctree.Branch[PL] =>
    
    def demoteLeaf(point: PL, leaf: Leaf): Unit = ???
  }
}

Output

Reference to PL is ambiguous,
it is both defined in class Impl
and inherited subsequently in trait LeftBranchImpl

Expectation

It's clear that PL unambiguously refers to the same thing. This compiles in 2.13.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions