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

Ill-typed code crashes hard in adaptToImplicitMethod

    Details

      Description

      object Test {
        class Foo()(implicit ev: Any)
        new Foo(): String
      }
      

      Regression occurred after 2.10.0-M3, I'm trying to pinpoint it now.

      Error:

        ~/code/scratch scalac210 /Users/jason/code/scratch/either.scala 
      error: 
           while compiling:  /Users/jason/code/scratch/either.scala
             current phase:  typer
           library version:  version 2.10.0-20120504-065643-e52be82eef
          compiler version:  version 2.10.0-20120504-065643-e52be82eef
        reconstructed args:  
       
      uncaught exception during compilation: java.lang.AssertionError
      error: java.lang.AssertionError: assertion failed: 
           while compiling:  /Users/jason/code/scratch/either.scala
             current phase:  typer
           library version:  version 2.10.0-20120504-065643-e52be82eef
          compiler version:  version 2.10.0-20120504-065643-e52be82eef
        reconstructed args:  
       
      class scala.reflect.api.Trees$Apply
      	at scala.tools.nsc.ast.Trees$ResetAttrs.transform(Trees.scala:365)
      	at scala.tools.nsc.ast.Trees$class.resetAllAttrs(Trees.scala:267)
      	at scala.tools.nsc.Global.resetAllAttrs(Global.scala:34)
      	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$adaptToImplicitMethod$1$1.apply(Typers.scala:857)
      	at scala.tools.nsc.typechecker.Typers$Typer.adaptToImplicitMethod$1(Typers.scala:846)
      	at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1070)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5014)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4788)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5005)
      	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:2558)
      	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59$$anonfun$60.apply(Typers.scala:2654)
      	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59$$anonfun$60.apply(Typers.scala:2654)
      	at scala.collection.immutable.List.loop$1(List.scala:163)
      	at scala.collection.immutable.List.mapConserve(List.scala:179)
      	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59.apply(Typers.scala:2654)
      	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2653)
      	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1718)
      	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$40.apply(Typers.scala:1626)
      	at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1625)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4646)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5005)
      	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:2558)
      	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59$$anonfun$60.apply(Typers.scala:2654)
      	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59$$anonfun$60.apply(Typers.scala:2654)
      	at scala.collection.immutable.List.loop$1(List.scala:163)
      	at scala.collection.immutable.List.mapConserve(List.scala:179)
      	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59.apply(Typers.scala:2654)
      	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2653)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4639)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5005)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5063)
      	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:97)
      	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:430)
      	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:89)
      	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:89)
      	at scala.collection.Iterator$class.foreach(Iterator.scala:706)
      	at scala.collection.AbstractIterator.foreach(Iterator.scala:1133)
      	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:89)
      	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1344)
      	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1317)
      	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1311)
      	at scala.tools.nsc.Global$Run.compile(Global.scala:1444)
      	at scala.tools.nsc.Driver.doCompile(Driver.scala:31)
      	at scala.tools.nsc.Main$.doCompile(Main.scala:81)
      	at scala.tools.nsc.Driver.process(Driver.scala:52)
      	at scala.tools.nsc.Driver.main(Driver.scala:65)
      	at scala.tools.nsc.Main.main(Main.scala)
       
      Exception in thread "main" java.lang.AssertionError: assertion failed: 
           while compiling:  /Users/jason/code/scratch/either.scala
             current phase:  typer
           library version:  version 2.10.0-20120504-065643-e52be82eef
          compiler version:  version 2.10.0-20120504-065643-e52be82eef
        reconstructed args:  
       
      class scala.reflect.api.Trees$Apply
      	at scala.tools.nsc.ast.Trees$ResetAttrs.transform(Trees.scala:365)
      	at scala.tools.nsc.ast.Trees$class.resetAllAttrs(Trees.scala:267)
      	at scala.tools.nsc.Global.resetAllAttrs(Global.scala:34)
      	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$adaptToImplicitMethod$1$1.apply(Typers.scala:857)
      	at scala.tools.nsc.typechecker.Typers$Typer.adaptToImplicitMethod$1(Typers.scala:846)
      	at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1070)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5014)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4788)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5005)
      	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:2558)
      	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59$$anonfun$60.apply(Typers.scala:2654)
      	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59$$anonfun$60.apply(Typers.scala:2654)
      	at scala.collection.immutable.List.loop$1(List.scala:163)
      	at scala.collection.immutable.List.mapConserve(List.scala:179)
      	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59.apply(Typers.scala:2654)
      	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2653)
      	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1718)
      	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$40.apply(Typers.scala:1626)
      	at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1625)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4646)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5005)
      	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:2558)
      	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59$$anonfun$60.apply(Typers.scala:2654)
      	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59$$anonfun$60.apply(Typers.scala:2654)
      	at scala.collection.immutable.List.loop$1(List.scala:163)
      	at scala.collection.immutable.List.mapConserve(List.scala:179)
      	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59.apply(Typers.scala:2654)
      	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2653)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:4639)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5005)
      	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5063)
      	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:97)
      	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:430)
      	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:89)
      	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:89)
      	at scala.collection.Iterator$class.foreach(Iterator.scala:706)
      	at scala.collection.AbstractIterator.foreach(Iterator.scala:1133)
      	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:89)
      	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1344)
      	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1317)
      	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1311)
      	at scala.tools.nsc.Global$Run.compile(Global.scala:1444)
      	at scala.tools.nsc.Driver.doCompile(Driver.scala:31)
      	at scala.tools.nsc.Main$.doCompile(Main.scala:81)
      	at scala.tools.nsc.Driver.process(Driver.scala:52)
      	at scala.tools.nsc.Driver.main(Driver.scala:65)
      	at scala.tools.nsc.Main.main(Main.scala)
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: