Closed
Description
This works:
final class Two[A, B]()
final class Bla
object Test {
type Foo[X] = X match
case Two[Bla, _] =>
String
case Two[String, _] =>
Int
def test: Foo[Two[String, String]] = 1
}
But if I add a type parameter to Bla, then it doesn't work anymore:
final class Two[A, B]()
final class Bla[A]
object Test {
type Foo[X] = X match
case Two[Bla[_], _] =>
String
case Two[String, _] =>
Int
def test: Foo[Two[String, String]] = 1
}
-- [E007] Type Mismatch Error: try/i8644.scala:28:39 ---------------------------
28 | def test: Foo[Two[String, String]] = 1
| ^
| Found: (1 : Int)
| Required: Test.Foo[Two[String, String]]