Scala Programming Language
  1. Scala Programming Language
  2. SI-5583

REPL crasher in specialize, "scala.reflect.internal.Types$TypeError: method foreach$mVc$sp: (f: Int => Unit)Unit does not take type parameters"

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Scala 2.10.0
    • Fix Version/s: None
    • Component/s: Specialization
    • Environment:

      Scala version 2.10.0-M2-0152-g5dca64cefe-2012-03-13 (OpenJDK 64-Bit Server VM, Java 1.7.0_03-icedtea)

      Description

      scala>   var s = 0
      s: Int = 0
      
      scala> for (i <- 1 to 10) {s += i}
      
      scala> for (i <- 1 to 10) {s += i}
      error: 
           while compiling:  <console>
             current phase:  specialize
           library version:  version 2.10.0-M2-0152-g5dca64cefe-2012-03-13
          compiler version:  version 2.10.0-M2-0152-g5dca64cefe-2012-03-13
        reconstructed args:  
      
      uncaught exception during compilation: scala.reflect.internal.Types$TypeError
      scala.reflect.internal.Types$TypeError: method foreach$mVc$sp: (f: Int => Unit)Unit does not take type parameters.
      	at scala.tools.nsc.typechecker.Contexts$Context.issue(Contexts.scala:318)
      	at scala.tools.nsc.typechecker.ContextErrors$ErrorUtils$.issueTypeError(ContextErrors.scala:78)
      	at scala.tools.nsc.typechecker.ContextErrors$ErrorUtils$.issueNormalTypeError(ContextErrors.scala:63)
      	at scala.tools.nsc.typechecker.ContextErrors$TyperContextErrors$TyperErrorGen$.TypedApplyDoesNotTakeTpeParametersError(ContextErrors.scala:456)
      	at scala.tools.nsc.typechecker.Typers$Typer.typedTypeApply(Typers.scala:3192)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4377)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4545)
      	at scala.tools.nsc.typechecker.Typers$Typer.typedOperator(Typers.scala:4637)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1354)
      	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1336)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1529)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transform$4.apply(Trees.scala:1278)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transform$4.apply(Trees.scala:1277)
      	at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1395)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:19)
      	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1276)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1529)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:1370)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:1370)
      	at scala.collection.immutable.List.loop$1(List.scala:151)
      	at scala.collection.immutable.List.mapConserve(List.scala:167)
      	at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:1370)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$17.apply(SpecializeTypes.scala:1422)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$17.apply(SpecializeTypes.scala:1422)
      	at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1395)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1422)
      	at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:1372)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1268)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1267)
      	at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1395)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:19)
      	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1266)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1529)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:1370)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:1370)
      	at scala.collection.immutable.List.loop$1(List.scala:151)
      	at scala.collection.immutable.List.mapConserve(List.scala:167)
      	at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:1370)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$17.apply(SpecializeTypes.scala:1422)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$17.apply(SpecializeTypes.scala:1422)
      	at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1395)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1422)
      	at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:1372)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1268)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1267)
      	at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1395)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:19)
      	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1266)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1529)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:1370)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:1370)
      	at scala.collection.immutable.List.loop$1(List.scala:151)
      	at scala.collection.immutable.List.mapConserve(List.scala:167)
      	at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:1370)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$17.apply(SpecializeTypes.scala:1422)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$17.apply(SpecializeTypes.scala:1422)
      	at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1395)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1422)
      	at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:1372)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1268)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1267)
      	at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1395)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:19)
      	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1266)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:53)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1529)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$2.apply(Trees.scala:1388)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$2.apply(Trees.scala:1386)
      	at scala.collection.immutable.List.loop$1(List.scala:151)
      	at scala.collection.immutable.List.mapConserve(List.scala:167)
      	at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:1386)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$16.apply(SpecializeTypes.scala:1409)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2$$anonfun$transform$16.apply(SpecializeTypes.scala:1407)
      	at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1395)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
      	at scala.tools.nsc.transform.SpecializeTypes$$anon$2.transform(SpecializeTypes.scala:1407)
      	at scala.tools.nsc.transform.SpecializeTypes$SpecializationTransformer.transform(SpecializeTypes.scala:1737)
      	at scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:205)
      	at scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:30)
      	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:423)
      	at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:389)
      	at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:383)
      	at scala.collection.Iterator$class.foreach(Iterator.scala:687)
      	at scala.collection.AbstractIterator.foreach(Iterator.scala:1112)
      	at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:383)
      	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1288)
      	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1261)
      	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1255)
      	at scala.tools.nsc.interpreter.IMain.compileSourcesKeepingRun(IMain.scala:442)
      	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compileAndSaveRun(IMain.scala:828)
      	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compile(IMain.scala:786)
      	at scala.tools.nsc.interpreter.IMain$Request.compile(IMain.scala:941)
      	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:613)
      	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:580)
      	at scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:777)
      	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:828)
      	at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:734)
      	at scala.tools.nsc.interpreter.ILoop.processLine$1(ILoop.scala:598)
      	at scala.tools.nsc.interpreter.ILoop.innerLoop$1(ILoop.scala:605)
      	at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:608)
      	at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply$mcZ$sp(ILoop.scala:905)
      	at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:870)
      	at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:870)
      	at scala.tools.nsc.util.ScalaClassLoader$.savingContextLoader(ScalaClassLoader.scala:155)
      	at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:870)
      	at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:79)
      	at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:92)
      	at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:101)
      	at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
      

      No crash on 2.9.1.

        Activity

        Hide
        Simon Ochsenreither added a comment -

        It works in Scala version 2.10.0-20120430-094203-cfd037271e (OpenJDK 64-Bit Server VM, Java 1.7.0_03).
        Was probably just a hiccup.

        Show
        Simon Ochsenreither added a comment - It works in Scala version 2.10.0-20120430-094203-cfd037271e (OpenJDK 64-Bit Server VM, Java 1.7.0_03). Was probably just a hiccup.
        Hide
        Vlad Ureche added a comment -

        It's not fixed for good, Paul just masked the error before Scaladays, but I need to investigate further.

        Show
        Vlad Ureche added a comment - It's not fixed for good, Paul just masked the error before Scaladays, but I need to investigate further.

          People

          • Assignee:
            Vlad Ureche
            Reporter:
            Simon Ochsenreither
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Development