In scala the _
in variable names is specifically used to denote that all of the following characters are part of the variable name up until a white space. So in your case type_
is a fine variable name, but when you put it in a method signature type_:
it infers the colon as part of the variable name since there's no white space between the colon and underscore. For more detail you can see page 54 of Programming Scala.
Paraphrased from the book, the reason they did this is so you can do things like xyz_++=
as a variable or method name since xyz++=
would be interperepted as the operator xyz ++=
.