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

Overload resolution with FunctionN as expected type #4831

Open
allanrenucci opened this issue Jul 24, 2018 · 0 comments
Open

Overload resolution with FunctionN as expected type #4831

allanrenucci opened this issue Jul 24, 2018 · 0 comments
Labels
area:typer backlog No work planned on this by the core team for the time being. compat:scala2 itype:bug

Comments

@allanrenucci
Copy link
Contributor

object Test {
  def foo(c: String => Int) = c("Hello")

  def f(x: String): Int = 1
  def f: String => Int = _ => 2

  def main(args: Array[String]): Unit = {
    foo(f) // Dotty: 1, Scala 2: 2
  }
}

Overload resolution differs between Dotty and Scala2. dotc eta-expand the first overload, scalac picks the second overload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:typer backlog No work planned on this by the core team for the time being. compat:scala2 itype:bug
Projects
None yet
Development

No branches or pull requests

2 participants