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

don't crash with "Error: trying to do lub/glb of typevar ?T" #5559

Closed
scabug opened this issue Mar 9, 2012 · 15 comments · Fixed by scala/scala#6421
Closed

don't crash with "Error: trying to do lub/glb of typevar ?T" #5559

scabug opened this issue Mar 9, 2012 · 15 comments · Fixed by scala/scala#6421

Comments

@scabug
Copy link

scabug commented Mar 9, 2012

scalac crashes with the message below.

to reproduce: [snipped laborious cloning exercise, see comments for self-contained reproductions.]

@scabug
Copy link
Author

scabug commented Mar 9, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5559?orig=1
Reporter: bono8106
Affected Versions: 2.9.1, 2.11.8, 2.12.0
Duplicates #4090

@scabug
Copy link
Author

scabug commented Mar 9, 2012

bono8106 said:
The work-around is to add the intended type parameter to the method call site:

def namedThreadActorOf[R <: AnyRef, T <: R](interface: Class[R], impl: Class[T], name: String): R =
typedActors.typedActorOf(TypedProps(interface, impl).withDispatcher("dispatchers." + name))

becomes

def namedThreadActorOf[R <: AnyRef, T <: R](interface: Class[R], impl: Class[T], name: String): R =
typedActors.typedActorOf(TypedProps[T](interface, impl).withDispatcher("dispatchers." + name))

Looking at the method signatures of the methods involved above, TypedProps.apply, TypedActorFactory.typedActorOf and namedThreadActorOf makes my head spin. :)

Just a user-friendly message telling me that the inferencer gives up in this case would be nice.

@scabug
Copy link
Author

scabug commented Mar 11, 2012

bono8106 said:
Attempting to create an isolated code snippet to reproduce this bug resulted in getting what seems to be a correct error message about the problem described in this bug report.

The code snippet is here:

https://github.com/bono8106/scala-si/blob/master/src/main/scala/SI-5559.scala

@scabug
Copy link
Author

scabug commented May 2, 2012

@axel22 said:
This is a bug in the type inferencer:

object Test {
  
  class Inv[T]
  
  def foo[S](interface: Inv[_ >: S], implementation: Inv[S]) {}

  def bar[R, T <: R](interface: Inv[R], impl: Inv[T]) { 
    //foo[T](interface, impl)
    foo(interface, impl) // Compilation Error
    // Inv[R] <: Inv[_ >: S]
    // Inv[T] <: Inv[S]
    // ----------------------
    // R >: S
    // T == S
  }

}

@scabug
Copy link
Author

scabug commented Jan 5, 2013

@paulp said:
Here's another example.

def f[T](x1: Set[T]) = () => new { def apply(x2: Set[_ <: T]) = List(x1, x2) }

@scabug
Copy link
Author

scabug commented Jan 5, 2013

@paulp said:
Here's another, which I took from #4090 which I am closing as a duplicate.

object Bug {
  trait H[F[_]]
  def f[F[_], T, FT <: F[T]](h : H[F]) = 1
  f(new H[Set]{})
}

@scabug
Copy link
Author

scabug commented Jan 15, 2013

Espen Wiborg (espenhw) said:
This also bites me when using the Hamcrest matchers included with JUnit 4.11. I can probably find a minimal example if necessary.

@scabug
Copy link
Author

scabug commented Jan 15, 2013

@paulp said:
It might be interesting to have a java version of the bug. It's too big for one language.

@scabug
Copy link
Author

scabug commented Feb 7, 2013

@JamesIry said:
JamesIry/scala@975a19c doesn't get to the heart of the problem of why type vars are getting where we don't expect them but it does turn the crash into error messages https://gist.github.com/JamesIry/4735290. But Adriaan is concerned that there will be cases that don't get an error message and just silently flow through to nonsense.

@scabug
Copy link
Author

scabug commented Jun 5, 2013

@dragos said:
The hamcrest minimized version:

import org.hamcrest.CoreMatchers._
import org.junit.Assert._

class MyTest {

  var state = 10

  def test() {
    assertThat("Bad state before runToBreakpoint", state, anyOf(is(42), is(-42)))
  }
}

Use the following for build.sbt

name := "test-crash"

scalaVersion := "2.10.2-SNAPSHOT"

resolvers += Resolver.sonatypeRepo("snapshots")

libraryDependencies += "junit" % "junit" % "4.11"

It fails with virtually all Scala versions known to man [2.9.3 - 2.11.0-M3]

@scabug
Copy link
Author

scabug commented Aug 13, 2013

@JamesIry said:
2.10.3-RC1 is coming at the end of the week. If there isn't going to be a PR in the next couple of days then let's kick this to 2.10.4-RC1.

@scabug
Copy link
Author

scabug commented Apr 13, 2015

Duckpodger (duckpodger) said (edited by @retronym on Apr 15, 2015 11:58:39 AM UTC):
Another example cut down from a hamcrest based one

package object traitor {
  trait Matcher[X <: AnyRef]{}
  
  object Problem2{
    def allOf[X](x: Matcher[_ >: X], y: Matcher[_ >: X]) = new Matcher[X](){}
    def allOf[X](x: Matcher[_ >: X]*) = new Matcher[X](){}
  }
}

object ProblemMaker {
  import traitor._
  
  def equalTo[X](x: X) = new Matcher[X](){}
  val a = equalTo("g")
  val b = Problem2.allOf(a)
  val c = Problem2.allOf(a,a)
}

@scabug
Copy link
Author

scabug commented Apr 15, 2015

@retronym said:

  • overload resolution is attempting to find the more specific alternative of allOf.
  • it checks if the second alternative is compatible with arguments of the types of the first, e.g. would allOf#2(null : Matcher[_ >: X], null : Matcher[_ >: X]) typecheck?
  • It assigns a type variable to help infer the type argument of this application
  • It compares argument types pairwise against the formal parameter types. The param type is instantiated with the type variable, so this test is Matcher[_ >: X] <:< Matcher[_ >: X?].
  • Subtype checking finds an existential type on the LHS. L forSome { TS } is a subtype of U if we can replace existential quantifiers TS with type variables, and find a solution that satisfies the constraints imposed by the subtyping check. This ends up with type variables on the LHS and RHS of a type relation, which is not supported by our inference engine.
  • we bail out with the exception.

@scabug
Copy link
Author

scabug commented Sep 25, 2016

Samuel Grütter (samuelgruetter) said:
We ran into the same problem in RxScala, minimized example:

import scala.language.implicitConversions

object Bug extends App {

  class JObserver[T]
  class JSubscriber[T] extends JObserver[T]

  class Foo

  implicit def convertSubscriber[T](s: JSubscriber[_ >: T]): Foo = ???

  implicit def convertObserver[T](s: JObserver[_ >: T]): Foo = ???

  val jSubscriber: JSubscriber[_ >: Int] = ???

  val foo: Foo = jSubscriber // compiler crashes

}

It prevents us from creating an "asScala" extension method which works for all types, and we have to give it separate names for those types which are subtypes of others, see ReactiveX/RxScala#208 for the details.

@scabug
Copy link
Author

scabug commented Nov 4, 2016

@soc said:
Another instance of this, as reported in https://groups.google.com/forum/#!topic/scala-user/fot6Ke-iBDI:

sealed trait Foo[A]
case class Bar[A](f: A) extends Foo[A]

object Extractor {
  def unapply[A](f: Bar[_ >: A]): Option[A] = ??? // no crash if `f: Foo[_ >: A]`
}

object Main extends App {

  type X = Int

  val t: Foo[X] = ???

  t match {
    case Extractor(f) => f
    case _            => ???
  }
}
ReplGlobal.abort: trying to do lub/glb of typevar ?A
error:
  trying to do lub/glb of typevar ?A
     while compiling: <console>
        during phase: typer
     library version: version 2.12.0-RC2
    compiler version: version 2.12.0-RC2
  reconstructed args: -deprecation -feature

  last tree to typer: Ident(<unapply-selector>)
       tree position: line 20 of <console>
            tree tpe: Foo[Main.X] with Bar[_ >: A]
              symbol: value <unapply-selector>
   symbol definition: val <unapply-selector>: Foo[Main.X] with Bar[_ >: A] (a TermSymbol)
      symbol package: $line6
       symbol owners: value <unapply-selector> -> value <local Main> -> object Main -> object $iw -> object $iw -> object $read
           call site: object Main in package $line6

<Cannot read source file>
scala.reflect.internal.FatalError: 
  trying to do lub/glb of typevar ?A
     while compiling: <console>
        during phase: typer
     library version: version 2.12.0-RC2
    compiler version: version 2.12.0-RC2
  reconstructed args: -deprecation -feature

  last tree to typer: Ident(<unapply-selector>)
       tree position: line 20 of <console>
            tree tpe: Foo[$line6.$read.$iw.$iw.Main.X] with Bar[_ >: A]
              symbol: value <unapply-selector>
   symbol definition: val <unapply-selector>: Foo[$line6.$read.$iw.$iw.Main.X] with Bar[_ >: A] (a TermSymbol)
      symbol package: $line6
       symbol owners: value <unapply-selector> -> value <local Main> -> object Main -> object $iw -> object $iw -> object $read
           call site: object Main in package $line6

<Cannot read source file>
	at scala.reflect.internal.Reporting.abort(Reporting.scala:61)
	at scala.reflect.internal.Reporting.abort$(Reporting.scala:57)
	at scala.tools.nsc.interpreter.IMain$$anon$1.scala$tools$nsc$interpreter$ReplGlobal$$super$abort(IMain.scala:242)
	at scala.tools.nsc.interpreter.ReplGlobal.abort(ReplGlobal.scala:20)
	at scala.tools.nsc.interpreter.ReplGlobal.abort$(ReplGlobal.scala:18)
	at scala.tools.nsc.interpreter.IMain$$anon$1.abort(IMain.scala:242)
	at scala.reflect.internal.Types.stripType$1(Types.scala:4443)
	at scala.reflect.internal.Types.$anonfun$stripExistentialsAndTypeVars$4(Types.scala:4446)
	at scala.reflect.internal.Types.stripExistentialsAndTypeVars(Types.scala:4446)
	at scala.reflect.internal.Types.stripExistentialsAndTypeVars$(Types.scala:4420)
	at scala.reflect.internal.SymbolTable.stripExistentialsAndTypeVars(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.GlbLubs.lub1$1(GlbLubs.scala:310)
	at scala.reflect.internal.tpe.GlbLubs.lub0$1(GlbLubs.scala:304)
	at scala.reflect.internal.tpe.GlbLubs.lub(GlbLubs.scala:401)
	at scala.reflect.internal.tpe.GlbLubs.lub$(GlbLubs.scala:282)
	at scala.reflect.internal.SymbolTable.lub(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.GlbLubs.lub(GlbLubs.scala:261)
	at scala.reflect.internal.tpe.GlbLubs.lub$(GlbLubs.scala:254)
	at scala.reflect.internal.SymbolTable.lub(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.TypeConstraints.solveOne$1(TypeConstraints.scala:248)
	at scala.reflect.internal.tpe.TypeConstraints.$anonfun$solve$9(TypeConstraints.scala:260)
	at scala.reflect.internal.tpe.TypeConstraints.solve(TypeConstraints.scala:260)
	at scala.reflect.internal.tpe.TypeConstraints.solve$(TypeConstraints.scala:192)
	at scala.reflect.internal.SymbolTable.solve(SymbolTable.scala:16)
	at scala.reflect.internal.Types$ExistentialType.withTypeVars(Types.scala:2756)
	at scala.reflect.internal.tpe.TypeComparers.thirdTry$1(TypeComparers.scala:485)
	at scala.reflect.internal.tpe.TypeComparers.secondTry$1(TypeComparers.scala:452)
	at scala.reflect.internal.tpe.TypeComparers.firstTry$1(TypeComparers.scala:428)
	at scala.reflect.internal.tpe.TypeComparers.isSubType2(TypeComparers.scala:548)
	at scala.reflect.internal.tpe.TypeComparers.isSubType1(TypeComparers.scala:320)
	at scala.reflect.internal.tpe.TypeComparers.isSubType(TypeComparers.scala:278)
	at scala.reflect.internal.tpe.TypeComparers.isSubType$(TypeComparers.scala:240)
	at scala.reflect.internal.SymbolTable.isSubType(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.TypeComparers.secondTry$1(TypeComparers.scala:447)
	at scala.reflect.internal.tpe.TypeComparers.firstTry$1(TypeComparers.scala:428)
	at scala.reflect.internal.tpe.TypeComparers.isSubType2(TypeComparers.scala:548)
	at scala.reflect.internal.tpe.TypeComparers.isSubType1(TypeComparers.scala:320)
	at scala.reflect.internal.tpe.TypeComparers.isSubType(TypeComparers.scala:278)
	at scala.reflect.internal.tpe.TypeComparers.isSubType$(TypeComparers.scala:240)
	at scala.reflect.internal.SymbolTable.isSubType(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.TypeComparers.retry$3(TypeComparers.scala:522)
	at scala.reflect.internal.tpe.TypeComparers.$anonfun$isSubType2$4(TypeComparers.scala:542)
	at scala.reflect.internal.tpe.TypeComparers.$anonfun$isSubType2$4$adapted(TypeComparers.scala:542)
	at scala.collection.LinearSeqOptimized.exists(LinearSeqOptimized.scala:91)
	at scala.collection.LinearSeqOptimized.exists$(LinearSeqOptimized.scala:88)
	at scala.reflect.internal.tpe.TypeComparers.fourthTry$1(TypeComparers.scala:542)
	at scala.reflect.internal.tpe.TypeComparers.thirdTry$1(TypeComparers.scala:485)
	at scala.reflect.internal.tpe.TypeComparers.secondTry$1(TypeComparers.scala:452)
	at scala.reflect.internal.tpe.TypeComparers.firstTry$1(TypeComparers.scala:428)
	at scala.reflect.internal.tpe.TypeComparers.isSubType2(TypeComparers.scala:548)
	at scala.reflect.internal.tpe.TypeComparers.isSubType1(TypeComparers.scala:320)
	at scala.reflect.internal.tpe.TypeComparers.isSubType(TypeComparers.scala:278)
	at scala.reflect.internal.tpe.TypeComparers.isSubType$(TypeComparers.scala:240)
	at scala.reflect.internal.SymbolTable.isSubType(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.TypeComparers.isWeakSubType(TypeComparers.scala:571)
	at scala.reflect.internal.tpe.TypeComparers.isWeakSubType$(TypeComparers.scala:552)
	at scala.reflect.internal.SymbolTable.isWeakSubType(SymbolTable.scala:16)
	at scala.reflect.internal.Types$Type.weak_$less$colon$less(Types.scala:835)
	at scala.tools.nsc.typechecker.Infer$Inferencer.isCompatible(Infer.scala:307)
	at scala.tools.nsc.typechecker.Infer$Inferencer.$anonfun$methTypeArgs$3(Infer.scala:547)
	at scala.tools.nsc.typechecker.Infer$Inferencer.methTypeArgs(Infer.scala:541)
	at scala.tools.nsc.typechecker.Infer$Inferencer.inferMethodInstance(Infer.scala:994)
	at scala.tools.nsc.typechecker.Typers$Typer.handlePolymorphicCall$1(Typers.scala:3604)
	at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3609)
	at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4647)
	at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4681)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5447)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5464)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5500)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5530)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5474)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5478)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5555)
	at scala.tools.nsc.typechecker.Typers$Typer.typedPos(Typers.scala:5562)
	at scala.tools.nsc.typechecker.PatternTypers$PatternTyper.doTypedUnapply(PatternTypers.scala:307)
	at scala.tools.nsc.typechecker.PatternTypers$PatternTyper.doTypedUnapply$(PatternTypers.scala:263)
	at scala.tools.nsc.typechecker.Typers$Typer.doTypedUnapply(Typers.scala:111)
	at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3622)
	at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3614)
	at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4647)
	at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4681)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5447)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5464)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5500)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5530)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5474)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5478)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedPattern$2(Typers.scala:5616)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedPattern$1(Typers.scala:5616)
	at scala.tools.nsc.interpreter.ReplGlobal$$anon$1.typingInPattern(ReplGlobal.scala:23)
	at scala.tools.nsc.typechecker.Typers$Typer.typedPattern(Typers.scala:5616)
	at scala.tools.nsc.typechecker.Typers$Typer.typedCase(Typers.scala:2481)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedCases$1(Typers.scala:2521)
	at scala.tools.nsc.typechecker.Typers$Typer.typedCases(Typers.scala:2520)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMatch(Typers.scala:2532)
	at scala.tools.nsc.typechecker.Typers$Typer.typedVirtualizedMatch$1(Typers.scala:4397)
	at scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:5426)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5457)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5464)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5500)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5530)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5474)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5478)
	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5559)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3058)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$8(Typers.scala:3187)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3187)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1975)
	at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1846)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5414)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5463)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5500)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5530)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5474)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5478)
	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5559)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3058)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$8(Typers.scala:3187)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3187)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1975)
	at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1846)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5414)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5463)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5500)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5530)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5474)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5478)
	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5559)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3058)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$8(Typers.scala:3187)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3187)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1975)
	at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1846)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5414)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5463)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5500)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5530)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5474)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5478)
	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5559)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3058)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$8(Typers.scala:3187)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3187)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1975)
	at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1846)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5414)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5463)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5500)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5530)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5474)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5478)
	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5559)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3058)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$8(Typers.scala:3187)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3187)
	at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5113)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5416)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5463)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5500)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5530)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5474)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5478)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5555)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:102)
	at scala.tools.nsc.Global$GlobalPhase.$anonfun$applyPhase$1(Global.scala:402)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:395)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1(Analyzer.scala:94)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1$adapted(Analyzer.scala:93)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:932)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1404)
	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1389)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1384)
	at scala.tools.nsc.interpreter.IMain.compileSourcesKeepingRun(IMain.scala:430)
	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compileAndSaveRun(IMain.scala:801)
	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compile(IMain.scala:759)
	at scala.tools.nsc.interpreter.IMain$Request.compile$lzycompute(IMain.scala:948)
	at scala.tools.nsc.interpreter.IMain$Request.compile(IMain.scala:943)
	at scala.tools.nsc.interpreter.IMain.compile(IMain.scala:599)
	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:588)
	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:560)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:825)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:843)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:843)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:843)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:843)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:843)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:843)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:843)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:843)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:843)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:843)
	at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:684)
	at scala.tools.nsc.interpreter.ILoop.processLine(ILoop.scala:402)
	at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:423)
	at scala.tools.nsc.interpreter.ILoop.$anonfun$process$1(ILoop.scala:993)
	at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:892)
	at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:79)
	at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:92)
	at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:103)
	at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:108)
	at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

joroKr21 added a commit to joroKr21/scala that referenced this issue Mar 12, 2018
by existentially abstracting them.

Adds a necessary boolean flag to `existentialAbstraction` to flip
the variance for upper bounds which need to be minimized.

Fixes scala/bug#5559, fixes scala/bug#5579 and fixes scala/bug#10519
joroKr21 added a commit to joroKr21/scala that referenced this issue Mar 13, 2018
by existentially abstracting them.

Adds a necessary boolean flag to `existentialAbstraction` to flip
the variance for upper bounds which need to be minimized.

Fixes scala/bug#5559, fixes scala/bug#5579, fixes scala/bug#10519
and fixes scala/bug#10771
joroKr21 added a commit to joroKr21/scala that referenced this issue Apr 24, 2018
by existentially abstracting them.

Adds a necessary boolean flag to `existentialAbstraction` to flip
the variance for upper bounds which need to be minimized.

Fixes scala/bug#5559, fixes scala/bug#5579, fixes scala/bug#10519
and fixes scala/bug#10771
joroKr21 added a commit to joroKr21/scala that referenced this issue Apr 26, 2018
by existentially abstracting them.

Adds a necessary boolean flag to `existentialAbstraction` to flip
the variance for upper bounds which need to be minimized.

Fixes scala/bug#5559, fixes scala/bug#5579, fixes scala/bug#10519
and fixes scala/bug#10771
adriaanm pushed a commit to joroKr21/scala that referenced this issue Aug 8, 2018
by existentially abstracting them.

Adds a necessary boolean flag to `existentialAbstraction` to flip
the variance for upper bounds which need to be minimized.

Fixes scala/bug#5559, fixes scala/bug#5579, fixes scala/bug#10519
and fixes scala/bug#10771
@SethTisue SethTisue added this to the 2.13.0-M5 milestone Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants