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

regression: assertion error in TypeRef#transform #8170

Closed
scabug opened this issue Jan 22, 2014 · 3 comments
Closed

regression: assertion error in TypeRef#transform #8170

scabug opened this issue Jan 22, 2014 · 3 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Jan 22, 2014

object ScalaZeee {
  trait HFold[M[_], U] {
    type Apply[E, A <: U] <: U
  }
  trait GenericCons[M[_], H, +T <: GenericList[M]] extends GenericList[M] {
    val tail: T
    override type Folded[N[X] >: M[X], U, F <: HFold[N, U]] = F#Apply[H, tail.Folded[N, U, F]]
  }
  val KNil: GenericList[Nothing] = ???
  sealed trait GenericList[+M[_]] {
     type Folded[N[X] >: M[X], U, F <: HFold[N, U]] <: U
  }
}

object TypelevelUsage {
  import ScalaZeee._
  type T = GenericCons[Some, String, KNil.type]
  val klist1: T = ???
  type T2 = klist1.Folded[Option, Int, HFold[Option, Int]]
  val count2: T2 = ???
  
  count2.ensuring(x => x) // trigger an implicit search
}
error: java.lang.AssertionError: assertion failed: (List(type N, type U, type F),List(type N, type U, type F))
	at scala.reflect.internal.Types$ArgsTypeRef.transform(Types.scala:1995)
	at scala.reflect.internal.Types$TypeRef.baseTypeSeqImpl(Types.scala:2309)
	at scala.reflect.internal.Types$class.defineBaseTypeSeqOfTypeRef(Types.scala:2452)

Regressed in #8046

@scabug
Copy link
Author

scabug commented Jan 22, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8170?orig=1
Reporter: @retronym
Affected Versions: 2.11.0-M8
See #8046

@scabug
Copy link
Author

scabug commented Jan 22, 2014

@retronym said (edited on Jan 22, 2014 1:52:46 PM UTC):
After a little whittling:

object O {
  trait X
  trait B extends A {
    override type T[F <: X] = F
  }
  trait A {
    type T[F <: X]
  }
}

object Test {
  import O._
  val a: B = ???
  val b: a.T[X] = ???
  b.ensuring(x => true) // trigger an implicit search
}

@scabug
Copy link
Author

scabug commented Jan 22, 2014

@retronym said:
scala/scala#3400

@scabug scabug closed this as completed Feb 5, 2014
@scabug scabug added this to the 2.11.0-RC1 milestone Apr 7, 2017
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