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

SI-9387 Fix VerifyError introduced by indylambda #4617

Merged
merged 1 commit into from
Jul 9, 2015

Conversation

retronym
Copy link
Member

@retronym retronym commented Jul 9, 2015

As with regular Apply-s, we should compute the generated type
based on the function's type, rather than the expected type.

In the test case, the expected type was void. Now, we correctly
use the generated type of scala/Function1, which is enough
to generate a subsequent POP instruction.

The tree shape involved was:

arg0 = {
  {
    $anonfun()
  };
  scala.runtime.BoxedUnit.UNIT
}

Review by @lrytz

Targetting to 2.12.x to expediate M2, but we should backport
this (along with one two other recent changes) to 2.11.x.

@scala-jenkins scala-jenkins added this to the 2.12.0-M3 milestone Jul 9, 2015
@retronym retronym modified the milestones: 2.12.0-M2, 2.12.0-M3 Jul 9, 2015
@retronym
Copy link
Member Author

retronym commented Jul 9, 2015

Assigned to the 2.12.0-M2, as this is a blocker for the release, /cc @SethTisue

@lrytz
Copy link
Member

lrytz commented Jul 9, 2015

here are two smaller test cases to reproduce the error, maybe we could add them?

object T {
  val f: Unit = () => ()
  println(f)
}

object U {
  def f[T](t: T): T = t
  f[Unit](() => ())
}

@lrytz
Copy link
Member

lrytz commented Jul 9, 2015

otherwise LGTM

@retronym
Copy link
Member Author

retronym commented Jul 9, 2015

Added.

@lrytz
Copy link
Member

lrytz commented Jul 9, 2015

i don't see them.. :)

As with regular `Apply`-s, we should compute the generated type
based on the function's type, rather than the expected type.

In the test case, the expected type was void. Now, we correctly
use the generated type of `scala/Function1`, which is enough
to generate a subsequent POP instruction.

The tree shape involved was:

```
arg0 = {
  {
    $anonfun()
  };
  scala.runtime.BoxedUnit.UNIT
}
```
@retronym
Copy link
Member Author

retronym commented Jul 9, 2015

Third time lucky.

@lrytz
Copy link
Member

lrytz commented Jul 9, 2015

LGTM

retronym added a commit that referenced this pull request Jul 9, 2015
SI-9387 Fix VerifyError introduced by indylambda
@retronym retronym merged commit 8a5aa6e into scala:2.12.x Jul 9, 2015
@@ -632,10 +632,11 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder {
case _ =>
abort(s"Cannot instantiate $tpt of kind: $generatedType")
}
case Apply(_, args) if app.hasAttachment[delambdafy.LambdaMetaFactoryCapable] =>
case Apply(fun, args) if app.hasAttachment[delambdafy.LambdaMetaFactoryCapable] =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything becomes better after fun is applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants