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

AssertionError with combo of by-name, default args, multiple parameter lists, undefined function #6563

Closed
scabug opened this issue Oct 24, 2012 · 5 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Oct 24, 2012

This is a regression.

Reproduce code (just compile it):

class A{
  def b(c: => Unit){}
  b{
    e("f")
    new G()(){}
 }
}
class G(h:String="i")()

Expected result (as in 2.9.1):

Bug.scala:4: error: not found: value e
    e("f")
    ^
one error found

Actual result:

error:
     while compiling: Bug.scala
        during phase: typer
     library version: version 2.10.0-RC1
    compiler version: version 2.10.0-RC1
  reconstructed args:

  last tree to typer: Literal(Constant(()))
              symbol: null
   symbol definition: null
                 tpe: Unit
       symbol owners:
      context owners: constructor $anon -> anonymous class $anon -> value <local A> -> class A -> package <empty>

== Enclosing template or block ==

Apply( // def <init>(h: String)(): G in class G, tree.tpe=<error>
  Apply( // def <init>(h: String)(): G in class G
    $anon.super."<init>" // def <init>(h: String)(): G in class G, tree.tpe=(h: String)()G
    Nil
  )
  Nil
)

== Expanded type of tree ==

TypeRef(TypeSymbol(final abstract class Unit extends AnyVal))

uncaught exception during compilation: java.lang.AssertionError
error: java.lang.AssertionError: assertion failed:
     while compiling: Bug.scala
        during phase: typer
     library version: version 2.10.0-RC1
    compiler version: version 2.10.0-RC1
  reconstructed args:

  last tree to typer: Literal(Constant(()))
              symbol: null
   symbol definition: null
                 tpe: Unit
       symbol owners:
      context owners: constructor $anon -> anonymous class $anon -> value <local A> -> class A -> package <empty>

== Enclosing template or block ==

Apply( // def <init>(h: String)(): G in class G, tree.tpe=<error>
  Apply( // def <init>(h: String)(): G in class G
    $anon.super."<init>" // def <init>(h: String)(): G in class G, tree.tpe=(h: String)()G
    Nil
  )
  Nil
)

== Expanded type of tree ==

TypeRef(TypeSymbol(final abstract class Unit extends AnyVal))

mismatch anonymous class $anon List(String) List()
        at scala.Predef$.assert(Predef.scala:179)
        at scala.tools.nsc.Global.assert(Global.scala:238)
        at scala.tools.nsc.typechecker.Typers$Typer.decompose$1(Typers.scala:1947)
        at scala.tools.nsc.typechecker.Typers$Typer.decompose$1(Typers.scala:1943)
        at scala.tools.nsc.typechecker.Typers$Typer.computeParamAliases(Typers.scala:1954)
        at scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:2170)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5370)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
        at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
        at scala.collection.immutable.List.loop$1(List.scala:164)
        at scala.collection.immutable.List.mapConserve(List.scala:180)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
        at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1856)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1721)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1721)
        at scala.tools.nsc.typechecker.Typers$Typer.typerReportAnyContextErrors(Typers.scala:505)
        at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1720)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5384)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
        at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
        at scala.collection.immutable.List.loop$1(List.scala:164)
        at scala.collection.immutable.List.mapConserve(List.scala:180)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
        at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2334)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typed1$1.apply(Typers.scala:5371)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typed1$1.apply(Typers.scala:5371)
        at scala.tools.nsc.typechecker.Typers$Typer.typerWithLocalContext(Typers.scala:497)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5371)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
        at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2335)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typed1$1.apply(Typers.scala:5371)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typed1$1.apply(Typers.scala:5371)
        at scala.tools.nsc.typechecker.Typers$Typer.typerWithLocalContext(Typers.scala:497)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5371)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$56.apply(Typers.scala:2864)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$56.apply(Typers.scala:2864)
        at scala.tools.nsc.typechecker.Typers$Typer.withCondConstrTyper(Typers.scala:488)
        at scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:2864)
        at scala.tools.nsc.typechecker.Typers$Typer.loop$1(Typers.scala:2891)
        at scala.tools.nsc.typechecker.Typers$Typer.typedArgs(Typers.scala:2897)
        at scala.tools.nsc.typechecker.Typers$Typer.handleMonomorphicCall$1(Typers.scala:3156)
        at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3200)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$86.apply(Typers.scala:4406)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$86.apply(Typers.scala:4406)
        at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:721)
        at scala.tools.nsc.typechecker.Typers$Typer.tryTypedApply$1(Typers.scala:4406)
        at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4459)
        at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4492)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5365)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
        at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
        at scala.collection.immutable.List.loop$1(List.scala:164)
        at scala.collection.immutable.List.mapConserve(List.scala:180)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
        at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1856)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1721)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1721)
        at scala.tools.nsc.typechecker.Typers$Typer.typerReportAnyContextErrors(Typers.scala:505)
        at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1720)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5384)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
        at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
        at scala.collection.immutable.List.loop$1(List.scala:164)
        at scala.collection.immutable.List.mapConserve(List.scala:180)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
        at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5111)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5388)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5493)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:98)
        at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:461)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:90)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:90)
        at scala.collection.Iterator$class.foreach(Iterator.scala:727)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1156)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:90)
        at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1574)
        at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1548)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:1544)
        at scala.tools.nsc.Global$Run.compile(Global.scala:1654)
        at scala.tools.nsc.Driver.doCompile(Driver.scala:33)
        at scala.tools.nsc.Main$.doCompile(Main.scala:79)
        at scala.tools.nsc.Driver.process(Driver.scala:54)
        at scala.tools.nsc.Driver.main(Driver.scala:67)
        at scala.tools.nsc.Main.main(Main.scala)

Exception in thread "main" java.lang.AssertionError: assertion failed:
     while compiling: Bug.scala
        during phase: typer
     library version: version 2.10.0-RC1
    compiler version: version 2.10.0-RC1
  reconstructed args:

  last tree to typer: Literal(Constant(()))
              symbol: null
   symbol definition: null
                 tpe: Unit
       symbol owners:
      context owners: constructor $anon -> anonymous class $anon -> value <local A> -> class A -> package <empty>

== Enclosing template or block ==

Apply( // def <init>(h: String)(): G in class G, tree.tpe=<error>
  Apply( // def <init>(h: String)(): G in class G
    $anon.super."<init>" // def <init>(h: String)(): G in class G, tree.tpe=(h: String)()G
    Nil
  )
  Nil
)

== Expanded type of tree ==

TypeRef(TypeSymbol(final abstract class Unit extends AnyVal))

mismatch anonymous class $anon List(String) List()
        at scala.Predef$.assert(Predef.scala:179)
        at scala.tools.nsc.Global.assert(Global.scala:238)
        at scala.tools.nsc.typechecker.Typers$Typer.decompose$1(Typers.scala:1947)
        at scala.tools.nsc.typechecker.Typers$Typer.decompose$1(Typers.scala:1943)
        at scala.tools.nsc.typechecker.Typers$Typer.computeParamAliases(Typers.scala:1954)
        at scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:2170)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5370)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
        at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
        at scala.collection.immutable.List.loop$1(List.scala:164)
        at scala.collection.immutable.List.mapConserve(List.scala:180)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
        at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1856)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1721)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1721)
        at scala.tools.nsc.typechecker.Typers$Typer.typerReportAnyContextErrors(Typers.scala:505)
        at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1720)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5384)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
        at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
        at scala.collection.immutable.List.loop$1(List.scala:164)
        at scala.collection.immutable.List.mapConserve(List.scala:180)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
        at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2334)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typed1$1.apply(Typers.scala:5371)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typed1$1.apply(Typers.scala:5371)
        at scala.tools.nsc.typechecker.Typers$Typer.typerWithLocalContext(Typers.scala:497)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5371)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
        at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2335)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typed1$1.apply(Typers.scala:5371)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typed1$1.apply(Typers.scala:5371)
        at scala.tools.nsc.typechecker.Typers$Typer.typerWithLocalContext(Typers.scala:497)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5371)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$56.apply(Typers.scala:2864)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$56.apply(Typers.scala:2864)
        at scala.tools.nsc.typechecker.Typers$Typer.withCondConstrTyper(Typers.scala:488)
        at scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:2864)
        at scala.tools.nsc.typechecker.Typers$Typer.loop$1(Typers.scala:2891)
        at scala.tools.nsc.typechecker.Typers$Typer.typedArgs(Typers.scala:2897)
        at scala.tools.nsc.typechecker.Typers$Typer.handleMonomorphicCall$1(Typers.scala:3156)
        at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3200)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$86.apply(Typers.scala:4406)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$86.apply(Typers.scala:4406)
        at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:721)
        at scala.tools.nsc.typechecker.Typers$Typer.tryTypedApply$1(Typers.scala:4406)
        at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4459)
        at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4492)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5365)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
        at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
        at scala.collection.immutable.List.loop$1(List.scala:164)
        at scala.collection.immutable.List.mapConserve(List.scala:180)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
        at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1856)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1721)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1721)
        at scala.tools.nsc.typechecker.Typers$Typer.typerReportAnyContextErrors(Typers.scala:505)
        at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1720)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5384)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
        at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
        at scala.collection.immutable.List.loop$1(List.scala:164)
        at scala.collection.immutable.List.mapConserve(List.scala:180)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
        at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5111)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5388)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5493)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:98)
        at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:461)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:90)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:90)
        at scala.collection.Iterator$class.foreach(Iterator.scala:727)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1156)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:90)
        at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1574)
        at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1548)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:1544)
        at scala.tools.nsc.Global$Run.compile(Global.scala:1654)
        at scala.tools.nsc.Driver.doCompile(Driver.scala:33)
        at scala.tools.nsc.Main$.doCompile(Main.scala:79)
        at scala.tools.nsc.Driver.process(Driver.scala:54)
        at scala.tools.nsc.Driver.main(Driver.scala:67)
        at scala.tools.nsc.Main.main(Main.scala)
@scabug
Copy link
Author

scabug commented Oct 24, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6563?orig=1
Reporter: @cvogt
Affected Versions: 2.10.0-RC1
See #6214, #7636

@scabug
Copy link
Author

scabug commented Dec 4, 2012

@retronym said (edited on Dec 4, 2012 2:54:54 PM UTC):
Regressed in

commit 8cfba0fb219a49cceeb0318a6562aa3a602d913c
Merge: 1f116e2 21fcf64
Author: Josh Suereth <Joshua.Suereth@gmail.com>
Date:   Mon Aug 13 09:52:58 2012 -0700

    Merge pull request #1125 from hubertp/2.10.x-issue/6214
    
    Fixes SI-6214.

@scabug
Copy link
Author

scabug commented Jan 25, 2013

@hubertp said:
I have a fix for that one in one of my branches. PR coming soonish.

@scabug
Copy link
Author

scabug commented May 20, 2013

@JamesIry said:
2.10.2 is about to be cut. Kicking down the road and un-assigning to foster work stealing.

@scabug
Copy link
Author

scabug commented Jan 6, 2014

@retronym said:
This was fixed in 2.10.3, test case submitted here: scala/scala#3329

@scabug scabug closed this as completed Jan 6, 2014
@scabug scabug added this to the 2.10.3 milestone Apr 7, 2017
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