-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Pickling crash compiling perspective
from community build
#13660
Comments
I minimized further to type Const[A] = [_] =>> A
type FunctionK[A[_], B[_]] = [Z] => A[Z] => B[Z]
type #~>#:[T, R] = FunctionK[Const[T], Const[R]]
object FunctionK:
def liftConst[A, B](f: A => B): /*FunctionK[Const[A], Const[B]]*/ A #~>#: B =
[Z1] => (a: A) => f(a)
trait FoldableK[F[_[_], _]]:
def foldMapK1[A[_], C, B](fa: F[A, C])(f: FunctionK[A, Const[B]]): B
def toListK[A, C](fa: F[Const[A], C]): List[A] =
foldMapK1(fa)(FunctionK.liftConst(List(_: A))) Interestingly, if I expand the alias What happens is:
Hence the orphan parameter. It looks like another instance of the problem where we have to avoid certain parameters in a constraint. @smarter, do we have a solution for that yet? |
Thanks for the minimization, I have wip branch where I'm working on this sort of issues so I'll keep this in mind. |
Remember comparisons of PolyTypes in `comparedTypeLambdas`. This means that parameters of such types will not be added to the constraint. We already do the same for HkTypeLambdas but for some reason we forgot to do it for PolyTypes, which are the other kind of type lambdas. Fixes scala#13660 Allows perspective to be re-enabled in CB
It turns out this had a more obvious fix: Just treat PolyTypes like HKTypeLambdas. |
Remember comparisons of PolyTypes in `comparedTypeLambdas`. This means that parameters of such types will not be added to the constraint. We already do the same for HkTypeLambdas but for some reason we forgot to do it for PolyTypes, which are the other kind of type lambdas. Fixes scala#13660 Allows perspective to be re-enabled in CB
Since #13650, compiling
perspective
results in a crash (it was disabled in the community build by 5793f90)A self-contained version of the offending code is below.
/cc @Katrix
Compiler version
3.1.1-RC1-bin-SNAPSHOT-git-8c3e7a2
Minimized code
Output (click arrow to expand)
The text was updated successfully, but these errors were encountered: