You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following session demonstrates the error with existential bound:
Welcome to Scala version 2.10.0-M4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_31).
Type in expressions to have them evaluated.
Type :help for more information.
scala> def f(l: List[_]) =
| l map {case a::b => a}
:8: error: missing parameter type for expanded function
The argument types of an anonymous function must be fully known. (SLS 8.5)
Expected type was: ?
l map {case a::b => a}
^
When I specify the type parameter explicitly, the code compiles no problem:
The following session demonstrates the error with existential bound:
Welcome to Scala version 2.10.0-M4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_31).
Type in expressions to have them evaluated.
Type :help for more information.
scala> def f(l: List[_]) =
| l map {case a::b => a}
:8: error: missing parameter type for expanded function
The argument types of an anonymous function must be fully known. (SLS 8.5)
Expected type was: ?
l map {case a::b => a}
^
When I specify the type parameter explicitly, the code compiles no problem:
scala> def f[T](l: List[T]) =
| l map {case a::b => a}
f: [T](l: List[T])List[Any]
It's a regression from 2.9
The text was updated successfully, but these errors were encountered: