Skip to content

Instantly share code, notes, and snippets.

@Glavo
Created October 22, 2018 09:47
Show Gist options
  • Save Glavo/e0e039b45f8088cbf1d9776268230f7b to your computer and use it in GitHub Desktop.
Save Glavo/e0e039b45f8088cbf1d9776268230f7b to your computer and use it in GitHub Desktop.
Type Error
scala> type T = (Int, Char, String)
// defined alias type T = (Int, Char, String)
scala> val get: (t: T, i: Int) => Tuple.Elem[T, i.type] = (t, i) => t(i)
1 |val get: (t: T, i: Int) => Tuple.Elem[T, i.type] = (t, i) => t(i)
| ^^^^
|found: Int(i) match {
| case Int(0) => Int
| case [n1 <: Int] => typelevel.S[n1] => scala.Tuple.Elem[(Char, String), n1]
|}
|required: (Int match {
| case Int(0) => Int
| case
| [n1 <: Int] => typelevel.S[n1'] =>
| n1' match {
| case Int(0) => Char
| case
| [n1 <: Int] => typelevel.S[n1''] =>
| n1'' match {
| case Int(0) => String
| case
| [n1 <: Int] => typelevel.S[n1'''] =>
| scala.Tuple.Elem[Unit, n1''']
| }
| }
|}) &
| (Int(i) match {
| case Int(0) => Int
| case
| [n1 <: Int] => typelevel.S[n1''''] =>
| n1'''' match {
| case Int(0) => Char
| case
| [n1 <: Int] => typelevel.S[n1'''''] =>
| n1''''' match {
| case Int(0) => String
| case
| [n1 <: Int] => typelevel.S[n1'''] =>
| scala.Tuple.Elem[Unit, n1''']
| }
| }
| })
|
|where: n1 is a type variable with constraint <: Int
| n1' is a type variable with constraint <: Int
| n1'' is a type variable with constraint <: Int
| n1''' is a type variable with constraint <: Int
| n1'''' is a type variable with constraint <: Int
| n1''''' is a type variable with constraint <: Int
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment