Skip to content

regression on eta expansion of vararg methods #14367

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

Closed
bjornregnell opened this issue Jan 27, 2022 · 1 comment · Fixed by #14397
Closed

regression on eta expansion of vararg methods #14367

bjornregnell opened this issue Jan 27, 2022 · 1 comment · Fixed by #14397
Assignees
Milestone

Comments

@bjornregnell
Copy link
Contributor

Compiler version

3.1.1

Minimized code and output

Welcome to Scala 3.1.1 (11.0.13, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                                               
scala> def m(i: Int*) = i.sum
def m(i: Int*): Int
                                                                                                                               
scala> val f = m _
-- [E081] Type Error: ---------------------------------------------------------------------------------------------------------
1 |val f = m _
  |        ^
  |        Missing parameter type
  |
  |        I could not infer the type of the parameter i.
1 error found

But it works if the type is given explicitly:

scala> val f: Seq[Int] => Int = m
val f: Seq[Int] => Int = Lambda$1433/0x0000000800768840@434d001d

Expectation

It works in Scala 2 so this is a regression:

Welcome to Scala 2.13.8 (OpenJDK 64-Bit Server VM, Java 11.0.13).
Type in expressions for evaluation. Or try :help.

scala> def m(i: Int*) = i.sum
def m(i: Int*): Int

scala> val f = m _
val f: Seq[Int] => Int = $Lambda$1132/0x00000001006bf040@4def7d36
@bjornregnell
Copy link
Contributor Author

Related to #14368

@anatoliykmetyuk anatoliykmetyuk added area:typer regression This worked in a previous version but doesn't anymore and removed stat:needs triage Every issue needs to have an "area" and "itype" label regression This worked in a previous version but doesn't anymore labels Jan 28, 2022
@odersky odersky self-assigned this Jan 31, 2022
odersky added a commit to dotty-staging/dotty that referenced this issue Feb 1, 2022
olsdavis pushed a commit to olsdavis/dotty that referenced this issue Apr 4, 2022
@Kordyjan Kordyjan added this to the 3.1.3 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants