The problem is using the uppercase letters I and O in your template. You should try to replace it with the lowercase letters val (i, o) = foo() . The Scala Language Specification claims that the definition of a value can be extended to match the pattern. For example, the definition of val x :: xs = mylist expands to the following (see page 39):
val x$ = mylist match { case x :: xs => {x, xs} } val x = x$._1 val xs = x$._2
In your case, the definition of the value val (i, o) = foo() expands in a similar way. However, the language specification also states that the pattern match contains lowercase letters (see page 114):
The variable x is a simple identifier that begins with a lower letter letter.
fynn source share