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

AdaptTypeError - foundType is Erroneous: <error>{def g: Unit} (in typer phase) #10015

Closed
scabug opened this issue Oct 31, 2016 · 1 comment
Closed
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Oct 31, 2016

The following case causes an assertion failure in the latest 2.12 version.

Unlike #10003, version 2.11.8 won't crash for this case. It seems to be a recent regression.

$ scalac -version
Scala compiler version 2.12.0-20161028-204919-0666377 -- Copyright 2002-2016, LAMP/EPFL and Lightbend, Inc.


$ scalac abc.scala
error: java.lang.AssertionError: assertion failed:
  AdaptTypeError - foundType is Erroneous: <error>{def g: Unit}
     while compiling: abc.scala
        during phase: typer
     library version: version 2.12.0-20161028-204919-0666377
    compiler version: version 2.12.0-20161028-204919-0666377
  reconstructed args:

  last tree to typer: Select(New, <init>)
       tree position: line 3 of abc.scala
            tree tpe: ()<error>{def g: Unit}
              symbol: constructor $anon
   symbol definition: def <init>(): $anon (a MethodSymbol)
      symbol package: <empty>
       symbol owners: constructor $anon -> <$anon: <error>> -> value <local Bar> -> class Bar
           call site: class Bar in package <empty>

== Source file context for tree position ==

     0 class Bar {
     1   def f (x : { def g }) {}
     2   f (new Foo { def g })
     3 }
        at scala.tools.nsc.Global.assert(Global.scala:229)
        at scala.tools.nsc.typechecker.ContextErrors$TyperContextErrors$TyperErrorGen$.AdaptTypeError(ContextErrors.scala:216)
        at scala.tools.nsc.typechecker.Typers$Typer.adaptMismatchedSkolems$1(Typers.scala:1044)
        at scala.tools.nsc.typechecker.Typers$Typer.lastTry$1(Typers.scala:1055)
        at scala.tools.nsc.typechecker.Typers$Typer.adaptExprNotFunMode$1(Typers.scala:1110)
        at scala.tools.nsc.typechecker.Typers$Typer.vanillaAdapt$1(Typers.scala:1156)
        at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1200)
        at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5519)
        at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5535)

(...)


$ cat abc.scala
class Bar {
  def f (x : { def g }) {}
  f (new Foo { def g })
}
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

3 participants