Created
October 22, 2018 09:47
-
-
Save Glavo/e0e039b45f8088cbf1d9776268230f7b to your computer and use it in GitHub Desktop.
Type Error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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