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

Explicitly eta-expanded methods never get a SAM type #9449

Closed
scabug opened this issue Aug 26, 2015 · 3 comments
Closed

Explicitly eta-expanded methods never get a SAM type #9449

scabug opened this issue Aug 26, 2015 · 3 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Aug 26, 2015

From https://gitter.im/scala/scala?at=55dcfde86ebe0cd61264329a:

trait II {
  def apply(x: Int): Int
}

object Test {
  def ii(x: Int): Int = x
  def test = {
    val ii1: II = x => ii(x) // works
    val ii2: II = ii         // works (adapting `ii` to `II`)
    val ii3: II = ii _       // fails
                             // typedTyped({ii : (() => <empty>)})
                             //    typedEta(ii, pt = II)
                             //       adapt(ii, pt = (? => ?))
                             //          instantiatedToMethodType(ii, pt = (? => ?))
    // val ii3: II = ii _ // error:
    // found   : Int => Int
    // required: II
  }
}
@scabug
Copy link
Author

scabug commented Aug 26, 2015

Imported From: https://issues.scala-lang.org/browse/SI-9449?orig=1
Reporter: Guillaume Martres (Smarter)
Affected Versions: 2.11.7

@scabug
Copy link
Author

scabug commented Feb 17, 2016

@lrytz said:
scala/scala#4945

@scabug
Copy link
Author

scabug commented Apr 5, 2016

@szeiger said:
Fixed by scala/scala#4971 as far as I can tell.

@scabug scabug closed this as completed Apr 5, 2016
@scabug scabug added the infer label Apr 7, 2017
@scabug scabug added this to the 2.12.0-M4 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants