Skip to content

Regression: 2.13.x higher kinded match requires type parameter bounds #11760

@soronpo

Description

@soronpo

When trying to match on a internal class of a higher kinded class, an error is generated for missing type arguments (works fine in 2.12.x and in dotty).
type arguments [_] do not conform to class Foo's type parameter bounds [B[I <: Int] <: Test.Bar[I]]

object Test {
  class Bar[I <: Int]
  class Foo[B[I <: Int] <: Bar[I]] {
    trait SomeThing
  }

  val x = new Bar[Int]

  x match {
    case y : Foo[_]#SomeThing => //error here
    case _ => 
  }  
}

I'll try to bisect this in the coming days and report back.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions