java.lang.AssertionError in the typer error message generation

48 views
Skip to first unread message

Simon Hafner

unread,
Mar 8, 2015, 9:48:24 PM3/8/15
to scala-i...@googlegroups.com
Source:

    trait AddMany[L <: Int, SL <: Int]

    object AddMany {
      type Aux[L <: Int, SL <: Int, Out0 <: Int] = AddMany[L, SL] { type Out = Out0 }

      def addMany[L <: Int, SL <: Int, H, Result <: Int]: Aux[L, SL, Result] =
          new AddMany[L, Tail, H] { type Out = adder.Out }
    }

The error occurred while developing a function for shapeless, but it's reproducible with any type, that's where the <: Int come from.

error generated:

    error: java.lang.AssertionError: assertion failed:
      (AnyRef{type Out = <error>},AddMany.Aux[L,SL,Result])
         while compiling: src/main/scala/bug.scala
            during phase: typer
         library version: version 2.11.5
        compiler version: version 2.11.5
      reconstructed args:

      last tree to typer: Select(New, <init>)
           tree position: line 7 of src/main/scala/bug.scala
                tree tpe: ()AnyRef{type Out = <error>}
                  symbol: constructor $anon
       symbol definition: def <init>(): $anon (a MethodSymbol)
          symbol package: <empty>
           symbol owners: constructor $anon -> <$anon: AnyRef> -> method addMany -> object AddMany
               call site: method addMany in object AddMany in package <empty>

    == Source file context for tree position ==

         4
         5   def addMany[L <: Int, SL <: Int, H, Result <: Int]: Aux[L, SL, Result] =
         6       new AddMany[L, Tail, H] { type Out = adder.Out }
         7 }
            at scala.tools.nsc.typechecker.ContextErrors$TyperContextErrors$TyperErrorGen$.AdaptTypeError(ContextErrors.scala:208)
            at scala.tools.nsc.typechecker.Typers$Typer.adaptMismatchedSkolems$1(Typers.scala:1003)
            at scala.tools.nsc.typechecker.Typers$Typer.fallbackAfterVanillaAdapt$1(Typers.scala:1072)
            at scala.tools.nsc.typechecker.Typers$Typer.vanillaAdapt$1(Typers.scala:1109)
            at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1152)
            at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5387)
            at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5400)
            at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5347)
            at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5351)
            at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2364)
            at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedOutsidePatternMode$1$1.apply(Typers.scala:5295)
            at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedOutsidePatternMode$1$1.apply(Typers.scala:5295)
            at scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:5294)
            at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5330)
            at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5337)
            at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5373)
            at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5400)
            at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5347)
            at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5351)
            at scala.tools.nsc.typechecker.Typers$Typer.transformedOrTyped(Typers.scala:5582)
            at scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:2190)
            at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5285)
            at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5336)
            at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5373)
            at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5400)
            at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5347)
            at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5351)
            at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5429)
            at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:3028)
            at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3132)
            at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3132)
            at scala.collection.immutable.List.loop$1(List.scala:173)
            at scala.collection.immutable.List.mapConserve(List.scala:189)
            at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3132)
            at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1903)
            at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1790)
            at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5287)
            at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5336)
            at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5373)
            at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5400)
            at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5347)
            at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5351)
            at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5429)
            at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:3028)
            at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3132)
            at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3132)
            at scala.collection.immutable.List.loop$1(List.scala:173)
            at scala.collection.immutable.List.mapConserve(List.scala:189)
            at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3132)
            at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:4989)
            at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5289)
            at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5336)
            at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5373)
            at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5400)
            at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5347)
            at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5351)
            at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5425)
            at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:102)
            at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:441)
            at scala.tools.nsc.Global$GlobalPhase.withCurrentUnit(Global.scala:432)
            at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:441)
            at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:94)
            at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:93)
            at scala.collection.Iterator$class.foreach(Iterator.scala:750)
            at scala.collection.AbstractIterator.foreach(Iterator.scala:1202)
            at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
            at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1500)
            at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1487)
            at scala.tools.nsc.Global$Run.compileSources(Global.scala:1482)
            at scala.tools.nsc.Global$Run.compile(Global.scala:1580)
            at scala.tools.nsc.Driver.doCompile(Driver.scala:32)
            at scala.tools.nsc.MainClass.doCompile(Main.scala:23)
            at scala.tools.nsc.Driver.process(Driver.scala:51)
            at scala.tools.nsc.Driver.main(Driver.scala:64)
            at scala.tools.nsc.Main.main(Main.scala)
    Exception in thread "main" java.lang.AssertionError: assertion failed: 
      (AnyRef{type Out = <error>},AddMany.Aux[L,SL,Result])
         while compiling: src/main/scala/bug.scala
            during phase: typer
         library version: version 2.11.5
        compiler version: version 2.11.5
      reconstructed args: 

      last tree to typer: Select(New, <init>)
           tree position: line 7 of src/main/scala/bug.scala
                tree tpe: ()AnyRef{type Out = <error>}
                  symbol: constructor $anon
       symbol definition: def <init>(): $anon (a MethodSymbol)
          symbol package: <empty>
           symbol owners: constructor $anon -> <$anon: AnyRef> -> method addMany -> object AddMany
               call site: method addMany in object AddMany in package <empty>

    == Source file context for tree position ==

         4 
         5   def addMany[L <: Int, SL <: Int, H, Result <: Int]: Aux[L, SL, Result] =
         6       new AddMany[L, Tail, H] { type Out = adder.Out }
         7 }
            at scala.tools.nsc.typechecker.ContextErrors$TyperContextErrors$TyperErrorGen$.AdaptTypeError(ContextErrors.scala:208)
            at scala.tools.nsc.typechecker.Typers$Typer.adaptMismatchedSkolems$1(Typers.scala:1003)
            at scala.tools.nsc.typechecker.Typers$Typer.fallbackAfterVanillaAdapt$1(Typers.scala:1072)
            at scala.tools.nsc.typechecker.Typers$Typer.vanillaAdapt$1(Typers.scala:1109)
            at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1152)
            at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5387)
            at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5400)
            at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5347)
            at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5351)
            at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2364)
            at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedOutsidePatternMode$1$1.apply(Typers.scala:5295)
            at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedOutsidePatternMode$1$1.apply(Typers.scala:5295)
            at scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:5294)
            at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5330)
            at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5337)
            at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5373)
            at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5400)
            at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5347)
            at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5351)
            at scala.tools.nsc.typechecker.Typers$Typer.transformedOrTyped(Typers.scala:5582)
            at scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:2190)
            at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5285)
            at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5336)
            at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5373)
            at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5400)
            at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5347)
            at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5351)
            at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5429)
            at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:3028)
            at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3132)
            at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3132)
            at scala.collection.immutable.List.loop$1(List.scala:173)
            at scala.collection.immutable.List.mapConserve(List.scala:189)
            at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3132)
            at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1903)
            at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1790)
            at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5287)
            at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5336)
            at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5373)
            at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5400)
            at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5347)
            at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5351)
            at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5429)
            at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:3028)
            at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3132)
            at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3132)
            at scala.collection.immutable.List.loop$1(List.scala:173)
            at scala.collection.immutable.List.mapConserve(List.scala:189)
            at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3132)
            at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:4989)
            at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5289)
            at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5336)
            at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5373)
            at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5400)
            at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5347)
            at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5351)
            at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5425)
            at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:102)
            at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:441)
            at scala.tools.nsc.Global$GlobalPhase.withCurrentUnit(Global.scala:432)
            at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:441)
            at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:94)
            at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:93)
            at scala.collection.Iterator$class.foreach(Iterator.scala:750)
            at scala.collection.AbstractIterator.foreach(Iterator.scala:1202)
            at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
            at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1500)
            at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1487)
            at scala.tools.nsc.Global$Run.compileSources(Global.scala:1482)
            at scala.tools.nsc.Global$Run.compile(Global.scala:1580)
            at scala.tools.nsc.Driver.doCompile(Driver.scala:32)
            at scala.tools.nsc.MainClass.doCompile(Main.scala:23)
            at scala.tools.nsc.Driver.process(Driver.scala:51)
            at scala.tools.nsc.Driver.main(Driver.scala:64)
            at scala.tools.nsc.Main.main(Main.scala)

Occurs with 2.11.4, 2.11.5, and 2.11.6

harv...@cse.ohio-state.edu

unread,
Aug 26, 2016, 8:54:23 AM8/26/16
to scala-internals
I think I hit this issue today too while writing some new typeclasses for Shapeless (Scala 2.11.8, shapeless 2.3.1).  I don't think it's a showstopper, but if it is, I will chime in again and try to provide my own set of reproduction steps.

Here is the compiler stack trace from SBT:

java.lang.AssertionError: assertion failed:
  (CoproductExtensions.this.FoldCases[C]{type Out = Int; type FIn = <error>; type FOut = <error>},org.oclc.vega.CoproductExtensions.FoldCases.Aux[C,FIn,FIn,folder.Out])
     while compiling: C:\research\workspace\cats-test\src\main\scala\org\oclc\vega\CoproductExtensions.scala
        during phase: typer
     library version: version 2.11.8
    compiler version: version 2.11.8
  reconstructed args: -Xlint:adapted-args -Xlint:nullary-unit -Xlint:inaccessible -Xlint:nullary-override -Xlint:infer-any -Xlint:missing-interpolator -Xlint:doc-detached -Xlint:private-shadow -Xlint:type-parameter-shadow -Xlint:poly-implicit-overload -Xlint:option-implicit -Xlint:delayedinit-select -Xlint:by-name-right-associative -Xlint:package-object-classes -Xlint:unsound-match -Xlint:stars-align -deprecation -Xfatal-warnings -bootclasspath C:\Program Files\Java\jdk1.8.0_45\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_45\jre\classes;C:\Users\harveyw\.ivy2\cache\org.scala-lang\scala-library\jars\scala-library-2.11.8.jar -classpath C:\research\workspace\cats-test\target\scala-2.11\classes;C:\Users\harveyw\.ivy2\cache\org.typelevel\cats_2.11\jars\cats_2.11-0.6.1.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\cats-macros_2.11\jars\cats-macros_2.11-0.6.1.jar;C:\Users\harveyw\.ivy2\cache\com.github.mpilquist\simulacrum_2.11\jars\simulacrum_2.11-0.7.0.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\machinist_2.11\jars\machinist_2.11-0.4.1.jar;C:\Users\harveyw\.ivy2\cache\org.scala-lang\scala-reflect\jars\scala-reflect-2.11.7.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\cats-kernel_2.11\jars\cats-kernel_2.11-0.6.1.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\cats-kernel-laws_2.11\jars\cats-kernel-laws_2.11-0.6.1.jar;C:\Users\harveyw\.ivy2\cache\org.scalacheck\scalacheck_2.11\jars\scalacheck_2.11-1.12.5.jar;C:\Users\harveyw\.ivy2\cache\org.scala-sbt\test-interface\jars\test-interface-1.0.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\discipline_2.11\jars\discipline_2.11-0.4.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\catalysts-platform_2.11\jars\catalysts-platform_2.11-0.0.2.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\catalysts-macros_2.11\jars\catalysts-macros_2.11-0.0.2.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\cats-core_2.11\jars\cats-core_2.11-0.6.1.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\cats-laws_2.11\jars\cats-laws_2.11-0.6.1.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\cats-free_2.11\jars\cats-free_2.11-0.6.1.jar;C:\Users\harveyw\.ivy2\cache\org.scalaz\scalaz-core_2.11\bundles\scalaz-core_2.11-7.2.2.jar;C:\Users\harveyw\.ivy2\cache\com.chuusai\shapeless_2.11\jars\shapeless_2.11-2.3.1.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\macro-compat_2.11\jars\macro-compat_2.11-1.1.1.jar;C:\Users\harveyw\.ivy2\cache\io.argonaut\argonaut_2.11\jars\argonaut_2.11-6.1a.jar;C:\Users\harveyw\.ivy2\cache\com.github.julien-truffaut\monocle-core_2.11\jars\monocle-core_2.11-1.2.1.jar;C:\Users\harveyw\.ivy2\cache\com.github.julien-truffaut\monocle-macro_2.11\jars\monocle-macro_2.11-1.2.1.jar;C:\Users\harveyw\.ivy2\cache\com.github.alexarchambault\argonaut-shapeless_6.1_2.11\jars\argonaut-shapeless_6.1_2.11-1.1.1.jar


  last tree to typer: Select(New, <init>)
       tree position: line 86 of C:\research\workspace\cats-test\src\main\scala\org\oclc\vega\CoproductExtensions.scala
            tree tpe: ()CoproductExtensions.this.FoldCases[C]
              symbol: constructor $anon
   symbol definition: def <init>(): CoproductExtensions.this.FoldCases[C] (a MethodSymbol)
      symbol package: org.oclc.vega
       symbol owners: constructor $anon -> <$anon: CoproductExtensions.this.FoldCases[C]> -> method baseFoldCases -> object FoldCases -> trait CoproductExtensions
           call site: method baseFoldCases in object FoldCases in package vega


== Source file context for tree position ==

    83
    84     implicit def baseFoldCases[C <: Coproduct, FIn <: HList, Z <: Coproduct](implicit zip: ZipWithHlist.Aux[FIn, C, Z], folder: Folder[FoldThingy.type, Z]): Aux[C, FIn, FIn, folder.Out] =
    85       new FoldCases[C] {
    86         type Out = Int
    87      
    88         type FIn = FIn0
    89         type FOut = FOut0
    at scala.tools.nsc.typechecker.ContextErrors$TyperContextErrors$TyperErrorGen$.AdaptTypeError(ContextErrors.scala:216)
    at scala.tools.nsc.typechecker.Typers$Typer.adaptMismatchedSkolems$1(Typers.scala:1017)
    at scala.tools.nsc.typechecker.Typers$Typer.fallbackAfterVanillaAdapt$1(Typers.scala:1086)
    at scala.tools.nsc.typechecker.Typers$Typer.vanillaAdapt$1(Typers.scala:1123)
    at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1166)
    at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5410)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
    at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
    at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2382)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedOutsidePatternMode$1$1.apply(Typers.scala:5318)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedOutsidePatternMode$1$1.apply(Typers.scala:5318)
    at scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:5317)
    at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5353)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5360)
    at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
    at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
    at scala.tools.nsc.typechecker.Typers$Typer.transformedOrTyped(Typers.scala:5605)
    at scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:2208)
    at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5308)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5359)
    at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
    at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
    at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5452)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:3047)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3151)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3151)

    at scala.collection.immutable.List.loop$1(List.scala:173)
    at scala.collection.immutable.List.mapConserve(List.scala:189)
    at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3151)
    at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1921)
    at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1808)
    at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5310)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5359)
    at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
    at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
    at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5452)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:3047)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3151)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3151)

    at scala.collection.immutable.List.loop$1(List.scala:173)
    at scala.collection.immutable.List.mapConserve(List.scala:189)
    at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3151)
    at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1921)
    at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1762)
    at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5309)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5359)
    at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
    at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
    at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5452)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:3047)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3151)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3151)

    at scala.collection.immutable.List.loop$1(List.scala:173)
    at scala.collection.immutable.List.mapConserve(List.scala:189)
    at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3151)
    at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5015)
    at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5312)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5359)
    at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
    at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5448)
    at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:102)
    at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:440)
    at scala.tools.nsc.Global$GlobalPhase.withCurrentUnit(Global.scala:431)
    at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:440)

    at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:94)
    at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:93)
    at scala.collection.Iterator$class.foreach(Iterator.scala:893)
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
    at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
    at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1501)
    at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1486)
    at scala.tools.nsc.Global$Run.compileSources(Global.scala:1481)
    at scala.tools.nsc.Global$Run.compile(Global.scala:1582)
    at xsbt.CachedCompiler0.run(CompilerInterface.scala:116)
    at xsbt.CachedCompiler0.run(CompilerInterface.scala:95)
    at xsbt.CompilerInterface.run(CompilerInterface.scala:26)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:101)
    at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:47)
    at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:41)
    at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply$mcV$sp(MixedAnalyzingCompiler.scala:51)
    at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:51)
    at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:51)
    at sbt.compiler.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:75)
    at sbt.compiler.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:50)
    at sbt.compiler.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:65)
    at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
    at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:66)
    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:64)
    at sbt.inc.IncrementalCommon.cycle(IncrementalCommon.scala:31)
    at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:62)
    at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:61)
    at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:89)
    at sbt.inc.Incremental$.compile(Incremental.scala:61)
    at sbt.inc.IncrementalCompile$.apply(Compile.scala:54)
    at sbt.compiler.IC$.compileInternal(IncrementalCompiler.scala:160)
    at sbt.compiler.IC$.incrementalCompile(IncrementalCompiler.scala:138)
    at sbt.Compiler$.compile(Compiler.scala:128)
    at sbt.Compiler$.compile(Compiler.scala:114)
    at sbt.Defaults$.sbt$Defaults$$compileIncrementalTaskImpl(Defaults.scala:814)
    at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:805)
    at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:803)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:235)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[error] (compile:compileIncremental) java.lang.AssertionError: assertion failed:
[error]   (CoproductExtensions.this.FoldCases[C]{type Out = Int; type FIn = <error>; type FOut = <error>},org.oclc.vega.CoproductExtensions.FoldCases.Aux[C,FIn,FIn,folder.Out])
[error]      while compiling: C:\research\workspace\cats-test\src\main\scala\org\oclc\vega\CoproductExtensions.scala
[error]         during phase: typer
[error]      library version: version 2.11.8
[error]     compiler version: version 2.11.8
[error]   reconstructed args: -Xlint:adapted-args -Xlint:nullary-unit -Xlint:inaccessible -Xlint:nullary-override -Xlint:infer-any -Xlint:missing-interpolator -Xlint:doc-detached -Xlint:private-shadow -Xlint:type-parameter-shadow -Xlint:poly-implicit-overload -Xlint:option-implicit -Xlint:delayedinit-select -Xlint:by-name-right-associative -Xlint:package-object-classes -Xlint:unsound-match -Xlint:stars-align -deprecation -Xfatal-warnings -bootclasspath C:\Program Files\Java\jdk1.8.0_45\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_45\jre\classes;C:\Users\harveyw\.ivy2\cache\org.scala-lang\scala-library\jars\scala-library-2.11.8.jar -classpath C:\research\workspace\cats-test\target\scala-2.11\classes;C:\Users\harveyw\.ivy2\cache\org.typelevel\cats_2.11\jars\cats_2.11-0.6.1.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\cats-macros_2.11\jars\cats-macros_2.11-0.6.1.jar;C:\Users\harveyw\.ivy2\cache\com.github.mpilquist\simulacrum_2.11\jars\simulacrum_2.11-0.7.0.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\machinist_2.11\jars\machinist_2.11-0.4.1.jar;C:\Users\harveyw\.ivy2\cache\org.scala-lang\scala-reflect\jars\scala-reflect-2.11.7.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\cats-kernel_2.11\jars\cats-kernel_2.11-0.6.1.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\cats-kernel-laws_2.11\jars\cats-kernel-laws_2.11-0.6.1.jar;C:\Users\harveyw\.ivy2\cache\org.scalacheck\scalacheck_2.11\jars\scalacheck_2.11-1.12.5.jar;C:\Users\harveyw\.ivy2\cache\org.scala-sbt\test-interface\jars\test-interface-1.0.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\discipline_2.11\jars\discipline_2.11-0.4.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\catalysts-platform_2.11\jars\catalysts-platform_2.11-0.0.2.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\catalysts-macros_2.11\jars\catalysts-macros_2.11-0.0.2.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\cats-core_2.11\jars\cats-core_2.11-0.6.1.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\cats-laws_2.11\jars\cats-laws_2.11-0.6.1.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\cats-free_2.11\jars\cats-free_2.11-0.6.1.jar;C:\Users\harveyw\.ivy2\cache\org.scalaz\scalaz-core_2.11\bundles\scalaz-core_2.11-7.2.2.jar;C:\Users\harveyw\.ivy2\cache\com.chuusai\shapeless_2.11\jars\shapeless_2.11-2.3.1.jar;C:\Users\harveyw\.ivy2\cache\org.typelevel\macro-compat_2.11\jars\macro-compat_2.11-1.1.1.jar;C:\Users\harveyw\.ivy2\cache\io.argonaut\argonaut_2.11\jars\argonaut_2.11-6.1a.jar;C:\Users\harveyw\.ivy2\cache\com.github.julien-truffaut\monocle-core_2.11\jars\monocle-core_2.11-1.2.1.jar;C:\Users\harveyw\.ivy2\cache\com.github.julien-truffaut\monocle-macro_2.11\jars\monocle-macro_2.11-1.2.1.jar;C:\Users\harveyw\.ivy2\cache\com.github.alexarchambault\argonaut-shapeless_6.1_2.11\jars\argonaut-shapeless_6.1_2.11-1.1.1.jar
[error]
[error]   last tree to typer: Select(New, <init>)
[error]        tree position: line 86 of C:\research\workspace\cats-test\src\main\scala\org\oclc\vega\CoproductExtensions.scala
[error]             tree tpe: ()CoproductExtensions.this.FoldCases[C]
[error]               symbol: constructor $anon
[error]    symbol definition: def <init>(): CoproductExtensions.this.FoldCases[C] (a MethodSymbol)
[error]       symbol package: org.oclc.vega
[error]        symbol owners: constructor $anon -> <$anon: CoproductExtensions.this.FoldCases[C]> -> method baseFoldCases -> object FoldCases -> trait CoproductExtensions
[error]            call site: method baseFoldCases in object FoldCases in package vega
[error]
[error] == Source file context for tree position ==
[error]
[error]     83
[error]     84     implicit def baseFoldCases[C <: Coproduct, FIn <: HList, Z <: Coproduct](implicit zip: ZipWithHlist.Aux[FIn, C, Z], folder: Folder[FoldThingy.type, Z]): Aux[C, FIn, FIn, folder.Out] =
[error]     85       new FoldCases[C] {
[error]     86         type Out = Int
[error]     87      
[error]     88         type FIn = FIn0
[error]     89         type FOut = FOut0
[error] Total time: 4 s, completed Aug 26, 2016 8:52:38 AM

Cheers,

William
Reply all
Reply to author
Forward
0 new messages