Created
June 9, 2021 11:13
-
-
Save milessabin/6754bdd2780f578f2079530ed3e9d7f5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
miles@tarski:~% cs launch scala3-repl | |
scala> trait A | |
| trait B | |
| type M[X] = X match | |
| case A => Int | |
| case B => String | |
| | |
// defined trait A | |
// defined trait B | |
scala> val x: String = ??? : M[B] | |
1 |val x: String = ??? : M[B] | |
| ^^^^^^^^^^ | |
| Found: M[B] | |
| Required: String | |
scala> class Inv[T] | |
// defined class Inv | |
scala> type M[X] = Inv[X] match | |
| case Inv[A] => Int | |
| case Inv[B] => String | |
| | |
scala> val x: String = ??? : M[B] | |
scala.NotImplementedError: an implementation is missing | |
at scala.Predef$.$qmark$qmark$qmark(Predef.scala:345) | |
... 28 elided | |
scala> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment