Skip to content

Nothing inferred in polymorphic, method with empty parameter list #7805

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
biboudis opened this issue Dec 19, 2019 · 1 comment
Closed

Nothing inferred in polymorphic, method with empty parameter list #7805

biboudis opened this issue Dec 19, 2019 · 1 comment

Comments

@biboudis
Copy link
Contributor

Nothing inferred in polymorphic, method with empty parameter list but Int inferred when method is parameterless.

minimized code

object Test {
  def meth[R <: Int]() : R = ???
  def main(args: Array[String]): Unit = {
    val person: Int = meth()
  }
}

expectation

It should work the same either with or without a parameter list.

object Test {
  def meth[R <: Int]: R = ???
  def main(args: Array[String]): Unit = {
    val person: Int = meth
  }
}
@odersky
Copy link
Contributor

odersky commented Mar 4, 2020

This is fixed by now, probably my one of the earlier type inference fixes.

@odersky odersky closed this as completed Mar 4, 2020
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

2 participants