Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing parameter type for anonymous function #5936

Closed
scabug opened this issue Jun 17, 2012 · 2 comments
Closed

missing parameter type for anonymous function #5936

scabug opened this issue Jun 17, 2012 · 2 comments

Comments

@scabug
Copy link

scabug commented Jun 17, 2012

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

@scabug
Copy link
Author

scabug commented Jun 17, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5936?orig=1
Reporter: @vigdorchik
Affected Versions: 2.10.0-M3
Duplicates #5330

@scabug
Copy link
Author

scabug commented Jun 17, 2012

@retronym said:
Dup of #5330

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant