Closed
Description
Not sure if this is a bug, a wanted limitation or just an overlook.
There are two issues with any-kinded types and match types.
- Inability to match against an any-kinded type.
- Inability to reduce an any-kinded type, when it "falls-in" the match through the "other" case clause.
Compiler version
Master branch
Minimized code
type Fix1[T <: AnyKind] = T match
case Option[a] => Option[a]
case Option => Option[Int]
type Fix2[T <: AnyKind] = T match
case Option[a] => Option[a]
case _ => Option[Int]
Output
[error] 3 | case Option => Option[Int]
[error] | ^^^^^^
[error] | Missing type parameter for Option
[error] 5 |type Fix2[T <: AnyKind] = T match
[error] | ^
[error] | Match type reduction failed since selector T
[error] | matches none of the cases
[error] |
[error] | case Option[a] => Option[a]
[error] | case _ => Option[Int]
Expectation
No error.