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

schtroumpfs crash type inference #7289

Closed
scabug opened this issue Mar 22, 2013 · 4 comments
Closed

schtroumpfs crash type inference #7289

scabug opened this issue Mar 22, 2013 · 4 comments

Comments

@scabug
Copy link

scabug commented Mar 22, 2013

object Test extends App {
  trait Schtroumpf[T]

  implicit def schtroumpf[T, U <: Coll[T], Coll[_] <: Traversable[_]]
    (implicit minorSchtroumpf: Schtroumpf[T]): Schtroumpf[U] = ???

  implicit val qoo = new Schtroumpf[Int]{}
  implicitly[Schtroumpf[Nil.type]]
}
21:48 ~/Projects/210x/sandbox (2.10.x)$ s
error:
     while compiling: Test.scala
        during phase: typer
     library version: version 2.10.2-20130320-161312-2f3a7fa417
    compiler version: version 2.10.2-20130320-161312-2f3a7fa417
  reconstructed args: -language:experimental.macros

  last tree to typer: Ident(Nil)
              symbol: <none> (flags: )
   symbol definition: <none>
       symbol owners:
      context owners: value <local Test> -> object Test -> package <empty>

== Enclosing template or block ==

Template( // val <local Test>: <notype> in object Test
  "App" // parents
  ValDef(
    private
    "_"
    <tpt>
    <empty>
  )
  // 5 statements
  DefDef( // def <init>(): Test.type in object Test
    <method>
    "<init>"
    []
    List(Nil)
    <tpt> // tree.tpe=Test.type
    Block( // tree.tpe=Unit
      Apply( // def <init>(): Object in class Object, tree.tpe=Object
        Test.super."<init>" // def <init>(): Object in class Object, tree.tpe=()Object
        Nil
      )
      ()
    )
  )
  ClassDef( // abstract trait Schtroumpf[T] extends AnyRef in object Test
    <interface> abstract <defaultparam/trait>
    "Schtroumpf"
    TypeDef( // T in trait Schtroumpf
      <deferred> <param>
      "T"
      []
      TypeBoundsTree(
        "_root_"."scala"."Nothing" // final abstract class Nothing extends Any in package scala, tree.tpe=Nothing
        "_root_"."scala"."Any" // abstract class Any extends  in package scala, tree.tpe=Any
      )
    )
    Template( // val <local Schtroumpf>: <notype> in trait Schtroumpf, tree.tpe=Test.Schtroumpf[T]
      "java.lang.Object" // parents
      ValDef(
        private
        "_"
        <tpt>
        <empty>
      )
      {}
    )
  )
  DefDef( // implicit def schtroumpf[T, U <: Coll[T], Coll[_] <: Traversable[_]](implicit minorSchtroumpf: Test.Schtroumpf[T]): Test.Schtroumpf[U] in object Test
    <method> implicit <triedcooking>
    "schtroumpf"
    // 3 type parameters
    TypeDef( // T
      <deferred> <param>
      "T"
      []
      TypeBoundsTree(
        "_root_"."scala"."Nothing" // final abstract class Nothing extends Any in package scala, tree.tpe=Nothing
        "_root_"."scala"."Any" // abstract class Any extends  in package scala, tree.tpe=Any
      )
    )
    TypeDef( // U <: Coll[T]
      <deferred> <param>
      "U"
      []
      TypeBoundsTree(
        "_root_"."scala"."Nothing" // final abstract class Nothing extends Any in package scala, tree.tpe=Nothing
        AppliedTypeTree( // Coll[_] <: Traversable[_]
          "Coll" // Coll[_] <: Traversable[_], tree.tpe=Coll
          "T" // T, tree.tpe=T
        )
      )
    )
    TypeDef( // Coll[_] <: Traversable[_]
      <deferred> <param>
      "Coll"
      TypeDef( // _
        <deferred> <param>
        "_"
        []
        TypeBoundsTree(
          "_root_"."scala"."Nothing" // final abstract class Nothing extends Any in package scala, tree.tpe=Nothing
          "_root_"."scala"."Any" // abstract class Any extends  in package scala, tree.tpe=Any
        )
      )
      TypeBoundsTree(
        "_root_"."scala"."Nothing" // final abstract class Nothing extends Any in package scala, tree.tpe=Nothing
        ExistentialTypeTree(
          AppliedTypeTree(
            "Traversable"
            "_$1" // type _$1, tree.tpe=_$1
          )
          List(
            TypeDef( // type _$1
              <deferred> <synthetic> <existential/mixedin>
              "_$1"
              []
              TypeBoundsTree(
                "_root_"."scala"."Nothing" // final abstract class Nothing extends Any in package scala, tree.tpe=Nothing
                "_root_"."scala"."Any" // abstract class Any extends  in package scala, tree.tpe=Any
              )
            )
          )
        )
      )
    )
    // 1 parameter list
    ValDef( // implicit minorSchtroumpf: Test.Schtroumpf[T]
      implicit <param>
      "minorSchtroumpf"
      AppliedTypeTree(
        "Schtroumpf"
        "T" // T, tree.tpe=T
      )
      <empty>
    )
    AppliedTypeTree( // tree.tpe=Test.Schtroumpf[U]
      "Schtroumpf"
      "U" // U <: Coll[T], tree.tpe=U
    )
    "$qmark$qmark$qmark"
  )
  ValDef( // private[this] val qoo: Test.Schtroumpf[Int] in object Test
    private implicit <local> <triedcooking>
    "qoo"
    <tpt> // tree.tpe=Test.Schtroumpf[Int]
    Block(
      ClassDef( // final class $anon extends Test.Schtroumpf[Int]
        final
        "$anon"
        []
        Template( // val <local $anon>: <notype>
          Schtroumpf[Int] // parents
          ValDef(
            private
            "_"
            <tpt>
            <empty>
          )
          // 2 statements
          DefDef( // def <init>(): Test.Schtroumpf[Int]
            <method> <triedcooking>
            "<init>"
            []
            List(Nil)
            <tpt> // tree.tpe=Test.Schtroumpf[Int]
            Block( // tree.tpe=Unit
              Apply( // def <init>(): Object in class Object, tree.tpe=Object
                $anon.super."<init>" // def <init>(): Object in class Object, tree.tpe=()Object
                Nil
              )
              ()
            )
          )
          <empty>
        )
      )
      Apply( // def <init>(): Test.Schtroumpf[Int], tree.tpe=Test.Schtroumpf[Int]
        new $anon."<init>" // def <init>(): Test.Schtroumpf[Int], tree.tpe=()Test.Schtroumpf[Int]
        Nil
      )
    )
  )
  TypeApply(
    "implicitly"
    AppliedTypeTree(
      "Schtroumpf"
      SingletonTypeTree( // tree.tpe=scala.collection.immutable.Nil.type
        "Nil"
      )
    )
  )
)

uncaught exception during compilation: java.lang.Error
error: java.lang.Error: Invalid type application in TypeVar: List(), List(Nothing)
	at scala.reflect.internal.Types$TypeVar.applyArgs(Types.scala:3094)
	at scala.reflect.internal.Types$class.appliedType(Types.scala:3695)
	at scala.reflect.internal.SymbolTable.appliedType(SymbolTable.scala:13)
	at scala.reflect.internal.Types$SubstMap.apply(Types.scala:4677)
	at scala.reflect.internal.Types$TypeMap.mapOver(Types.scala:4207)
	at scala.reflect.internal.Types$SubstMap.apply(Types.scala:4662)
	at scala.reflect.internal.Types$Type.subst(Types.scala:796)
	at scala.reflect.internal.Types$Type.instantiateTypeParams(Types.scala:572)
	at scala.reflect.internal.Types$$anonfun$instantiatedBounds$1.apply(Types.scala:6501)
	at scala.reflect.internal.Types$$anonfun$instantiatedBounds$1.apply(Types.scala:6501)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
	at scala.collection.immutable.List.foreach(List.scala:318)
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
	at scala.collection.AbstractTraversable.map(Traversable.scala:105)
	at scala.reflect.internal.Types$class.instantiatedBounds(Types.scala:6501)
	at scala.reflect.internal.SymbolTable.instantiatedBounds(SymbolTable.scala:13)
	at scala.reflect.internal.Types$class.isWithinBounds(Types.scala:6494)
	at scala.reflect.internal.SymbolTable.isWithinBounds(SymbolTable.scala:13)
	at scala.reflect.internal.Types$ExistentialType.withTypeVars(Types.scala:2843)
	at scala.reflect.internal.Types$class.thirdTry$1(Types.scala:6133)
	at scala.reflect.internal.Types$class.secondTry$1(Types.scala:6092)
	at scala.reflect.internal.Types$class.firstTry$1(Types.scala:6068)
	at scala.reflect.internal.Types$class.isSubType2(Types.scala:6211)
	at scala.reflect.internal.Types$class.isSubType(Types.scala:5820)
	at scala.reflect.internal.SymbolTable.isSubType(SymbolTable.scala:13)
	at scala.reflect.internal.Types$Type.$less$colon$less(Types.scala:872)
	at scala.tools.nsc.typechecker.Infer$Inferencer.isAsSpecificValueType(Infer.scala:933)
	at scala.tools.nsc.typechecker.Infer$Inferencer.isAsSpecific(Infer.scala:924)
	at scala.tools.nsc.typechecker.Infer$Inferencer.isAsSpecific(Infer.scala:922)
	at scala.tools.nsc.typechecker.Infer$Inferencer.isAsSpecific(Infer.scala:890)
	at scala.tools.nsc.typechecker.Infer$Inferencer.isStrictlyMoreSpecific(Infer.scala:964)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.improves(Implicits.scala:329)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation$$anonfun$16$$anonfun$apply$4.liftedTree1$1(Implicits.scala:851)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation$$anonfun$16$$anonfun$apply$4.apply(Implicits.scala:851)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation$$anonfun$16$$anonfun$apply$4.apply(Implicits.scala:850)
	at scala.collection.TraversableLike$$anonfun$filterNot$1.apply(TraversableLike.scala:274)
	at scala.collection.TraversableLike$$anonfun$filterNot$1.apply(TraversableLike.scala:274)
	at scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:264)
	at scala.collection.immutable.List.foreach(List.scala:318)
	at scala.collection.TraversableLike$class.filter(TraversableLike.scala:263)
	at scala.collection.AbstractTraversable.filter(Traversable.scala:105)
	at scala.collection.TraversableLike$class.filterNot(TraversableLike.scala:274)
	at scala.collection.AbstractTraversable.filterNot(Traversable.scala:105)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation$$anonfun$16.apply(Implicits.scala:850)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation$$anonfun$16.apply(Implicits.scala:850)
	at scala.reflect.internal.Types$UndoLog.undo(Types.scala:186)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.rankImplicits(Implicits.scala:849)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.findBest(Implicits.scala:876)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.searchImplicit(Implicits.scala:935)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.bestImplicit(Implicits.scala:1304)
	at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:82)
	at scala.tools.nsc.Global$$anon$1.inferImplicit(Global.scala:493)
	at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:37)
	at scala.tools.nsc.Global$$anon$1.inferImplicit(Global.scala:493)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$applyImplicitArgs$1.apply(Typers.scala:132)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$applyImplicitArgs$1.apply(Typers.scala:127)
	at scala.collection.immutable.List.foreach(List.scala:318)
	at scala.tools.nsc.typechecker.Typers$Typer.applyImplicitArgs(Typers.scala:127)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$adaptToImplicitMethod$1$1.apply(Typers.scala:883)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$adaptToImplicitMethod$1$1.apply(Typers.scala:865)
	at scala.tools.nsc.typechecker.Typers$Typer.withCondConstrTyper(Typers.scala:493)
	at scala.tools.nsc.typechecker.Typers$Typer.adaptToImplicitMethod$1(Typers.scala:865)
	at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1121)
	at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1119)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.typedImplicit1(Implicits.scala:610)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.typedImplicit0(Implicits.scala:562)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.scala$tools$nsc$typechecker$Implicits$ImplicitSearch$$typedImplicit(Implicits.scala:417)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.tryImplicitInfo$1(Implicits.scala:838)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.rankImplicits(Implicits.scala:841)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.findBest(Implicits.scala:876)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.searchImplicit(Implicits.scala:935)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.bestImplicit(Implicits.scala:1304)
	at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:82)
	at scala.tools.nsc.Global$$anon$1.inferImplicit(Global.scala:493)
	at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:37)
	at scala.tools.nsc.Global$$anon$1.inferImplicit(Global.scala:493)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$applyImplicitArgs$1.apply(Typers.scala:132)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$applyImplicitArgs$1.apply(Typers.scala:127)
	at scala.collection.immutable.List.foreach(List.scala:318)
	at scala.tools.nsc.typechecker.Typers$Typer.applyImplicitArgs(Typers.scala:127)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$adaptToImplicitMethod$1$1.apply(Typers.scala:883)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$adaptToImplicitMethod$1$1.apply(Typers.scala:865)
	at scala.tools.nsc.typechecker.Typers$Typer.withCondConstrTyper(Typers.scala:493)
	at scala.tools.nsc.typechecker.Typers$Typer.adaptToImplicitMethod$1(Typers.scala:865)
	at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1121)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5663)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2920)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3024)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3024)
	at scala.collection.immutable.List.loop$1(List.scala:170)
	at scala.collection.immutable.List.mapConserve(List.scala:186)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3024)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1913)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$29.apply(Typers.scala:1794)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$29.apply(Typers.scala:1794)
	at scala.tools.nsc.typechecker.Typers$Typer.typerReportAnyContextErrors(Typers.scala:510)
	at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1793)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5590)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5648)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2920)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3024)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3024)
	at scala.collection.immutable.List.loop$1(List.scala:170)
	at scala.collection.immutable.List.mapConserve(List.scala:186)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3024)
	at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5307)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5593)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5648)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5705)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:99)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:464)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:91)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:91)
	at scala.collection.Iterator$class.foreach(Iterator.scala:727)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:91)
	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1583)
	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1557)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1553)
	at scala.tools.nsc.Global$Run.compile(Global.scala:1662)
	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.Error: Invalid type application in TypeVar: List(), List(Nothing)
	at scala.reflect.internal.Types$TypeVar.applyArgs(Types.scala:3094)
	at scala.reflect.internal.Types$class.appliedType(Types.scala:3695)
	at scala.reflect.internal.SymbolTable.appliedType(SymbolTable.scala:13)
	at scala.reflect.internal.Types$SubstMap.apply(Types.scala:4677)
	at scala.reflect.internal.Types$TypeMap.mapOver(Types.scala:4207)
	at scala.reflect.internal.Types$SubstMap.apply(Types.scala:4662)
	at scala.reflect.internal.Types$Type.subst(Types.scala:796)
	at scala.reflect.internal.Types$Type.instantiateTypeParams(Types.scala:572)
	at scala.reflect.internal.Types$$anonfun$instantiatedBounds$1.apply(Types.scala:6501)
	at scala.reflect.internal.Types$$anonfun$instantiatedBounds$1.apply(Types.scala:6501)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
	at scala.collection.immutable.List.foreach(List.scala:318)
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
	at scala.collection.AbstractTraversable.map(Traversable.scala:105)
	at scala.reflect.internal.Types$class.instantiatedBounds(Types.scala:6501)
	at scala.reflect.internal.SymbolTable.instantiatedBounds(SymbolTable.scala:13)
	at scala.reflect.internal.Types$class.isWithinBounds(Types.scala:6494)
	at scala.reflect.internal.SymbolTable.isWithinBounds(SymbolTable.scala:13)
	at scala.reflect.internal.Types$ExistentialType.withTypeVars(Types.scala:2843)
	at scala.reflect.internal.Types$class.thirdTry$1(Types.scala:6133)
	at scala.reflect.internal.Types$class.secondTry$1(Types.scala:6092)
	at scala.reflect.internal.Types$class.firstTry$1(Types.scala:6068)
	at scala.reflect.internal.Types$class.isSubType2(Types.scala:6211)
	at scala.reflect.internal.Types$class.isSubType(Types.scala:5820)
	at scala.reflect.internal.SymbolTable.isSubType(SymbolTable.scala:13)
	at scala.reflect.internal.Types$Type.$less$colon$less(Types.scala:872)
	at scala.tools.nsc.typechecker.Infer$Inferencer.isAsSpecificValueType(Infer.scala:933)
	at scala.tools.nsc.typechecker.Infer$Inferencer.isAsSpecific(Infer.scala:924)
	at scala.tools.nsc.typechecker.Infer$Inferencer.isAsSpecific(Infer.scala:922)
	at scala.tools.nsc.typechecker.Infer$Inferencer.isAsSpecific(Infer.scala:890)
	at scala.tools.nsc.typechecker.Infer$Inferencer.isStrictlyMoreSpecific(Infer.scala:964)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.improves(Implicits.scala:329)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation$$anonfun$16$$anonfun$apply$4.liftedTree1$1(Implicits.scala:851)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation$$anonfun$16$$anonfun$apply$4.apply(Implicits.scala:851)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation$$anonfun$16$$anonfun$apply$4.apply(Implicits.scala:850)
	at scala.collection.TraversableLike$$anonfun$filterNot$1.apply(TraversableLike.scala:274)
	at scala.collection.TraversableLike$$anonfun$filterNot$1.apply(TraversableLike.scala:274)
	at scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:264)
	at scala.collection.immutable.List.foreach(List.scala:318)
	at scala.collection.TraversableLike$class.filter(TraversableLike.scala:263)
	at scala.collection.AbstractTraversable.filter(Traversable.scala:105)
	at scala.collection.TraversableLike$class.filterNot(TraversableLike.scala:274)
	at scala.collection.AbstractTraversable.filterNot(Traversable.scala:105)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation$$anonfun$16.apply(Implicits.scala:850)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation$$anonfun$16.apply(Implicits.scala:850)
	at scala.reflect.internal.Types$UndoLog.undo(Types.scala:186)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.rankImplicits(Implicits.scala:849)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.findBest(Implicits.scala:876)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.searchImplicit(Implicits.scala:935)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.bestImplicit(Implicits.scala:1304)
	at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:82)
	at scala.tools.nsc.Global$$anon$1.inferImplicit(Global.scala:493)
	at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:37)
	at scala.tools.nsc.Global$$anon$1.inferImplicit(Global.scala:493)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$applyImplicitArgs$1.apply(Typers.scala:132)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$applyImplicitArgs$1.apply(Typers.scala:127)
	at scala.collection.immutable.List.foreach(List.scala:318)
	at scala.tools.nsc.typechecker.Typers$Typer.applyImplicitArgs(Typers.scala:127)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$adaptToImplicitMethod$1$1.apply(Typers.scala:883)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$adaptToImplicitMethod$1$1.apply(Typers.scala:865)
	at scala.tools.nsc.typechecker.Typers$Typer.withCondConstrTyper(Typers.scala:493)
	at scala.tools.nsc.typechecker.Typers$Typer.adaptToImplicitMethod$1(Typers.scala:865)
	at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1121)
	at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1119)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.typedImplicit1(Implicits.scala:610)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.typedImplicit0(Implicits.scala:562)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.scala$tools$nsc$typechecker$Implicits$ImplicitSearch$$typedImplicit(Implicits.scala:417)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.tryImplicitInfo$1(Implicits.scala:838)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.rankImplicits(Implicits.scala:841)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.findBest(Implicits.scala:876)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.searchImplicit(Implicits.scala:935)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.bestImplicit(Implicits.scala:1304)
	at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:82)
	at scala.tools.nsc.Global$$anon$1.inferImplicit(Global.scala:493)
	at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:37)
	at scala.tools.nsc.Global$$anon$1.inferImplicit(Global.scala:493)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$applyImplicitArgs$1.apply(Typers.scala:132)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$applyImplicitArgs$1.apply(Typers.scala:127)
	at scala.collection.immutable.List.foreach(List.scala:318)
	at scala.tools.nsc.typechecker.Typers$Typer.applyImplicitArgs(Typers.scala:127)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$adaptToImplicitMethod$1$1.apply(Typers.scala:883)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$adaptToImplicitMethod$1$1.apply(Typers.scala:865)
	at scala.tools.nsc.typechecker.Typers$Typer.withCondConstrTyper(Typers.scala:493)
	at scala.tools.nsc.typechecker.Typers$Typer.adaptToImplicitMethod$1(Typers.scala:865)
	at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1121)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5663)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2920)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3024)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3024)
	at scala.collection.immutable.List.loop$1(List.scala:170)
	at scala.collection.immutable.List.mapConserve(List.scala:186)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3024)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1913)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$29.apply(Typers.scala:1794)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$29.apply(Typers.scala:1794)
	at scala.tools.nsc.typechecker.Typers$Typer.typerReportAnyContextErrors(Typers.scala:510)
	at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1793)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5590)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5648)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2920)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3024)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3024)
	at scala.collection.immutable.List.loop$1(List.scala:170)
	at scala.collection.immutable.List.mapConserve(List.scala:186)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3024)
	at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5307)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5593)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5648)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5705)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:99)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:464)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:91)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:91)
	at scala.collection.Iterator$class.foreach(Iterator.scala:727)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:91)
	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1583)
	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1557)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1553)
	at scala.tools.nsc.Global$Run.compile(Global.scala:1662)
	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 Mar 22, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7289?orig=1
Reporter: @xeno-by
Affected Versions: 2.10.1

@scabug
Copy link
Author

scabug commented Mar 23, 2013

@retronym said:
Regressed (or perhaps just uncovered) in c800d1fec ("Use context for buffering errors that cannot/shouldn't be reported in the given moment").

/*
info1 = {scala.tools.nsc.typechecker.Implicits$ImplicitInfo@3468}"qoo: => Test.Schtroumpf[Int]"
info2 = {scala.tools.nsc.typechecker.Implicits$ImplicitInfo@3469}"schtroumpf: [T, U <: Coll[T], Coll[_] <: Traversable[_]](implicit minorSchtroumpf: Test.Schtroumpf[T])Test.Schtroumpf[U]"
isStrictlyMoreSpecific(info1, info2)
  isSubType(Test.Schtroumpf[Int], Test.Schtroumpf[U] forSome { T; U <: Coll[T]; Coll[_] <: Traversable[_] })
    isAsSpecificValueType(Test.Schtroumpf[Int], Test.Schtroumpf[U], undef2 = List(type T, type U, type Coll))

      val et: ExistentialType = Test.Schtroumpf[U] forSome { T; U <: Coll[T]; Coll[_] <: Traversable[_] }
      val tp1 = Test.Schtroumpf[Int]
      et.withTypeVars(isSubType(tp1, _, depth))
        solve()
        tvars = tList(=?Nothing, =?Int, =?=?Int)


[    create] ?T                       ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] )
[    create] ?U                       ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] )
[    create] ?Coll                    ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] )
[   setInst] Nothing                  ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], T=Nothing )
[   setInst] scala.collection.immutable.Nil.type( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], U=scala.collection.immutable.Nil.type )
[   setInst] =?scala.collection.immutable.Nil.type( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], Coll==?scala.collection.immutable.Nil.type )
[    create] ?T                       ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] )
[   setInst] Int                      ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], T=Int )
[    create] ?T                       ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] )
[    create] ?U                       ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] )
[    create] ?Coll                    ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] )
[   setInst] Nothing                  ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], T=Nothing )
[   setInst] Int                      ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], U=Int )
[   setInst] =?Int                    ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], Coll==?Int )

@scabug
Copy link
Author

scabug commented Mar 23, 2013

@retronym said:
scala/scala#2294

@scabug
Copy link
Author

scabug commented Apr 9, 2013

@adriaanm said:
scala/scala#2354

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