-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Issue with Type inference? #1036
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
Comments
It might well be a duplicate of #998. Thanks for the analysis! |
I verified that it is not a duplicate of #998, after all. |
#1040 did not completely fix the bug. If I rewrite slightly the test case, it doesn't compile anymore. second(Set.empty[String], Set.empty) map (s => expectString(s))
third(Set.empty[String], Set.empty) map (s => expectString(s))
// Instead of
second(Set.empty[String], Set.empty) map expectString
third(Set.empty[String], Set.empty) map expectString
|
That looks like a bug / problem in scalac. scalac expands In the scenario given, we need to infer the parameter type for |
Do you have a specific example in mind where this could be problematic? It doesn't seem like such a bad idea to me. |
Achieved by tweaking from where we get the parameter types of an eta-expansion.
The following code snippet does not compile with Dotty but does with Scalac.
It fails with the following error:
It also fails to compile if
second
is defined as follow:with the following error:
Note that it does compile with
second
applied onList
instead ofSet
:Not sure if it is a duplicate of #998
The text was updated successfully, but these errors were encountered: