Created
September 12, 2016 23:38
-
-
Save milessabin/2cc749c84e504876cb6e9507993fa7c4 to your computer and use it in GitHub Desktop.
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> def stuff(xs: ::[Int]): Int = xs.head | |
stuff: (xs: ::[Int])Int | |
scala> stuff(Nil) | |
<console>:13: error: type mismatch; | |
found : scala.collection.immutable.Nil.type | |
required: ::[Int] | |
stuff(Nil) | |
^ | |
scala> stuff(::(1, ::(2, ::(3, Nil)))) | |
res0: Int = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment