We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import scala.compiletime.S sealed trait TList sealed trait TNil extends TList sealed trait ++:[H[_], T <: TList] extends TList type IndexOf[H[_], T <: TList] <: Int = T match case H ++: _ => 0 case _ ++: t => S[IndexOf[H, t]] // compiles fine val a = summon[ValueOf[IndexOf[List, List ++: Option ++: TNil]]].value // causes an error val b = summon[ValueOf[IndexOf[List, Option ++: List ++: TNil]]].value object T extends App: println(a)
[error] 45 |val b = summon[ValueOf[IndexOf[List, Option ++: List ++: TNil]]].value [error] | ^ [error] |No singleton value available for IndexOf[List, Option ++: List ++: TNil].
Note that if ++: is defined for a non-higher-kinded types (e.g. sealed trait ++:[H, T <: TList] extends TList) both of this cases compiles.
++:
sealed trait ++:[H, T <: TList] extends TList
The text was updated successfully, but these errors were encountered:
Same error with kind-polymorphic types:
import scala.compiletime.S sealed trait TList sealed trait TNil extends TList sealed trait ++:[H <: AnyKind, T <: TList] extends TList type IndexOf[H <: AnyKind, T <: TList] <: Int = T match case H ++: _ => 0 case _ ++: t => S[IndexOf[H, t]] // compiles fine val a = summon[ValueOf[IndexOf[Int, Float ++: Int ++: TNil]]].value // causes an error val b = summon[ValueOf[IndexOf[Int, List ++: Int ++: TNil]]].value
Sorry, something went wrong.
Fix scala#9675: Type _ in MT patterns with correct kind
057af51
6190702
Merge pull request #13262 from dotty-staging/fix-9675
fea778d
Fix #9675: Type _ in MT patterns with correct kind
71f144f
OlivierBlanvillain
No branches or pull requests
Minimized code
Output
Expectation
Note that if
++:
is defined for a non-higher-kinded types (e.g.sealed trait ++:[H, T <: TList] extends TList
) both of this cases compiles.The text was updated successfully, but these errors were encountered: