Skip to content

Regression: exception while transforming attempt of class class dotty.tools.dotc.ast.Trees$Ident #2233

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
olafurpg opened this issue Apr 12, 2017 · 8 comments

Comments

@olafurpg
Copy link
Contributor

See stacktrace while compiling scalatest with Dotty at commit 4b33e36 from April 11th: https://travis-ci.org/lampepfl/dotty-community-build/jobs/221252016#L7457

The build was green at commit 0bd7821 on April 10th: https://travis-ci.org/lampepfl/dotty-community-build/jobs/220858741#L261

@OlivierBlanvillain
Copy link
Contributor

It's a bit tricky to minimise scalatest issues, the best approach I can see is to git bisect from the dotty repo:

export COMPILERVERSION=0.1.1-SNAPSHOT
sbt publish-local && (cd ~/workspace/scalatest;  sbt ";clean ;compile")
# dotty doesn't compile     → git bisect skip
# scalatest doesn't compile → git bisect bad
# scalatest compiles        → git bisect good

Given that each step takes about ~5 minutes at full CPU, I think this really needs to be automated. Without a way to pinpoint a single commit/PR, it's really to even get started on such issues. But at the same time, if we keep things in a failing states, it defeats the purpose of the community build.

@smarter
Copy link
Member

smarter commented Apr 12, 2017

I've opened #2246 to track one possible cause of the issue.

@OlivierBlanvillain
Copy link
Contributor

I think the issue comes from this PR: #2128. Unfortunately many commits do not compile, so I could not reduce it to something small (git bisect says something went wrong between d5c1e6d and 87608bd).

@smarter
Copy link
Member

smarter commented Apr 13, 2017

The problem actually comes from PR #2216, minimization:

class Foo(x: Any => Any)

class Test {
  def foo(param: Int) = {
    class Hi extends Foo(_ => param)
  }
}
Exception in thread "main" java.lang.IllegalArgumentException: Could not find proxy for param: Int in List(val param, method foo, class Test, module class <empty>, module class <root>), encl = method $anonfun, owners = method $anonfun, constructor Hi, class Hi, method foo, class Test, package <empty>, package <root>; enclosures = method $anonfun, class Test, package <empty>, package <root>
        at dotty.tools.dotc.transform.LambdaLift$LambdaLifter.searchIn$1(LambdaLift.scala:425)
        at dotty.tools.dotc.transform.LambdaLift$LambdaLifter.proxy(LambdaLift.scala:438)
        at dotty.tools.dotc.transform.LambdaLift$LambdaLifter.dotty$tools$dotc$transform$LambdaLift$LambdaLifter$$proxyRef(LambdaLift.scala:456)
        at dotty.tools.dotc.transform.LambdaLift$LambdaLifter.transformIdent(LambdaLift.scala:510)

@olafurpg
Copy link
Contributor Author

I am still able to reproduce this error with dotty version 0.1.1-bin-20170427-fa13f8d-NIGHTLY

Here is a log of the stack trace crash-log.zip The output is truncated by Travis https://travis-ci.org/dotty-staging/scalatest/builds/226833950

@smarter
Copy link
Member

smarter commented Apr 28, 2017

@olafurpg This should be fixed once #2282 is merged.

@odersky
Copy link
Contributor

odersky commented Apr 28, 2017

@olafurpg #2282 was just merged. Can you check again? Thanks!

@olafurpg
Copy link
Contributor Author

I can confirm that the error message is no longer "java.lang.IllegalArgumentException: Could not find proxy for attempt:". We can close this issue.

There is now a new error

 [error] (compile:compileIncremental) java.lang.NoSuchMethodError: dotty.tools.dotc.reporting.UniqueMessagePositions.dotty$tools$dotc$reporting$UniqueMessagePositions$$initial$positions()Lscala/collection/mutable/HashMap;

I thought it was caused by an outdated dotty bridge but I'm on sbt 0.13.15 and using sbt-dotty 0.1.0-RC3.

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

No branches or pull requests

4 participants