Apologies if this is obvious but I am new to scala and I am getting two unexpected behaviors with the following code:
Seq(1, "a", 2, "b") map {
case i: Int => i+1
}
Run Code Online (Sandbox Code Playgroud)
1) I would have expected to get back a collection where the strings are unchanged and the numbers are incremented by 1 but instead I get an error.
2) I believe the case i: Int => i + 1 syntax represents a partial function which is …