Uploaded image for project: 'Scala Programming Language'
  1. Scala Programming Language
  2. SI-5696

Compiler exception on new anonymous class creation (with apply call)

    Details

      Description

      class TestApply {
        class G(y: Int) {
          def apply(x: Int) = 1
        }
       
        new G(1)(2) {}
      }
      

      java.lang.AssertionError: assertion failed: type can't convert from UNIT to REF(class TestApply$G) in unit Main.scala at source-C:\Users\Alexander.Podkhalyuz\IdeaProjects\LiftMavenTest\src\scalatest\Main.scala,line-8,offset=109
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase.adapt(GenICode.scala:1149)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1131)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadQualifier(GenICode.scala:1175)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:921)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genStat(GenICode.scala:174)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:143)
      at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:111)
      at scala.collection.immutable.List.foldLeft(List.scala:45)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genStat(GenICode.scala:143)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1052)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:114)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:69)
      at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
      at scala.collection.immutable.List.foreach(List.scala:45)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:69)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:136)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:88)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:79)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:65)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase.apply(GenICode.scala:61)
      at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:329)
      at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:297)
      at scala.collection.Iterator$class.foreach(Iterator.scala:660)
      at scala.collection.mutable.ListBuffer$$anon$1.foreach(ListBuffer.scala:316)
      at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:297)
      at scala.tools.nsc.backend.icode.GenICode$ICodePhase.run(GenICode.scala:54)
      at scala.tools.nsc.Global$Run.compileSources(Global.scala:953)
      at scala.tools.nsc.Global$Run.compile(Global.scala:1038)
      at scala.tools.nsc.Main$.process(Main.scala:106)
      at scala.tools.nsc.Main$.main(Main.scala:123)
      at scala.tools.nsc.Main.main(Main.scala)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jetbrains.plugins.scala.compiler.rt.ClassRunner.main(ClassRunner.java:46)
      Exception in thread "main" java.lang.reflect.InvocationTargetException

        Attachments

          Activity

            People

            • Assignee:
              retronym Jason Zaugg
              Reporter:
              alefas Alexander
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: