-
Notifications
You must be signed in to change notification settings - Fork 1.1k
assertion failed: orphan parameter reference #7888
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
Comments
The orphan parameter is the [A] in the polymorphic closure. |
I have a similar issue: trait T[A <: AnyKind]
given ts[A <: AnyKind]: T[A] = new T[A] {}
trait M[F[_[_], _]]
trait E[+R, +A]
type C[+R] = [a] =>> E[R, a]
def s[F[_[_], _], R, A](x: F[C[R | M[F]], A])(using t: T[F]) = ???
type A = M[AE]
sealed trait AE[F[_], A]
object A:
case class K[R, A](f: E[R, A]) extends AE[C[R], B[R, A]]
trait B[R, A]
def k[R, A: T](f: E[R, A]): E[R | A, B[R | A, A]] = s(K(f))
Output (click arrow to expand)
|
I've also often got this error. |
Another example: import scala.compiletime.ops.int._
import scala.compiletime.ops.boolean._
sealed trait Tree
case object Leaf extends Tree
final case class Branch[N <: Int & Singleton, L <: Tree, R <: Tree](n: N, l: L, r: R)(
using (L LeftOf N) =:= true) extends Tree
type LeftOf[T <: Tree, N <: Int] <: Boolean = T match {
case Leaf.type => true
case Branch[n, _, r] => n < N && (r LeftOf N)
}
val tree = Branch(1, Branch(0, Leaf, Leaf), Leaf) |
Still reproducible in 3.0.1-RC1 |
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Oct 3, 2021
olsdavis
pushed a commit
to olsdavis/dotty
that referenced
this issue
Apr 4, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
minimized code
Stack trace
The text was updated successfully, but these errors were encountered: