-
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
Fix subsumes test between constraints #13650
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The test gave a false negative in the case where a parameter was instantiated to the same value in both constraints. In that case the parameter is not "contained" in either constraint, since it is already instantiated, and that caused the test to fail. Fixes scala#13541
smarter
approved these changes
Oct 1, 2021
perspective now fails with the following stack trace ``` error when pickling type Z error when pickling type perspective.Const[List[A]][Z] error when pickling tree perspective.Const[List[A]][Z] error when pickling tree perspective.FoldableK.this.foldMapK[([_] =>> A), C](fa)[ perspective.Const[List[A]][Z] ] error when pickling tree perspective.FoldableK.this.foldMapK[([_] =>> A), C](fa)[ perspective.Const[List[A]][Z] ]( perspective.FunctionK.liftConst[A, List[A]]( { def $anonfun(_$5: A): List[A] = List.apply[A]([_$5:A : A]*) closure($anonfun) } ) ) error when pickling tree perspective.FoldableK.this.foldMapK[([_] =>> A), C](fa)[ perspective.Const[List[A]][Z] ]( perspective.FunctionK.liftConst[A, List[A]]( { def $anonfun(_$5: A): List[A] = List.apply[A]([_$5:A : A]*) closure($anonfun) } ) )(cats.kernel.Semigroup.catsKernelMonoidForList[A]) error when pickling tree extension [A >: Nothing <: Any, C >: Nothing <: Any]( fa: FoldableK.this.F[perspective.Const[A], C] ) def toListK: List[A] = this.foldMapK[([_] =>> A), C](fa)[perspective.Const[List[A]][Z]]( perspective.FunctionK.liftConst[A, List[A]]( { def $anonfun(_$5: A): List[A] = List.apply[A]([_$5:A : A]*) closure($anonfun) } ) )(cats.kernel.Semigroup.catsKernelMonoidForList[A]) error when pickling tree [ F[_[_ >: Nothing <: Any] >: Nothing <: Any, _ >: Nothing <: Any] >: Nothing <: Any ]() extends Object { F[_$1[_$2],_$3] extension [A[_ >: Nothing <: Any] >: Nothing <: Any, C >: Nothing <: Any]( fa: FoldableK.this.F[A, C] ) def foldLeftK[B >: Nothing <: Any](b: B)(f: B => A ~>#: B): B extension [A[_ >: Nothing <: Any] >: Nothing <: Any, C >: Nothing <: Any]( fa: FoldableK.this.F[A, C] ) def foldMapK[B >: Nothing <: Any](f: perspective.~>#:[A, B])(using B: cats.Monoid[B] ): B = this.foldLeftK[A, C](fa)[B](B.empty)( { def $anonfun(b: B): A ~>#: B = { final class $anon() extends Object(), PolyFunction { def apply[Z >: Nothing <: Any](az: A[Z]): B = cats.syntax.all.catsSyntaxSemigroup[B](b)(B).combine( f.apply[Z](az) ) } new $anon():([Z] => (A[Z]) => B) } closure($anonfun) } ) extension [A >: Nothing <: Any, C >: Nothing <: Any]( fa: FoldableK.this.F[perspective.Const[A], C] ) def toListK: List[A] = this.foldMapK[([_] =>> A), C](fa)[perspective.Const[List[A]][Z]]( perspective.FunctionK.liftConst[A, List[A]]( { def $anonfun(_$5: A): List[A] = List.apply[A]([_$5:A : A]*) closure($anonfun) } ) )(cats.kernel.Semigroup.catsKernelMonoidForList[A]) } error when pickling tree @sourcefile("dotty/perspective/src/main/scala/perspective/FoldableK.scala") trait FoldableK[ F[_[_ >: Nothing <: Any] >: Nothing <: Any, _ >: Nothing <: Any] >: Nothing <: Any ]() extends Object { F[_$1[_$2],_$3] extension [A[_ >: Nothing <: Any] >: Nothing <: Any, C >: Nothing <: Any]( fa: FoldableK.this.F[A, C] ) def foldLeftK[B >: Nothing <: Any](b: B)(f: B => A ~>#: B): B extension [A[_ >: Nothing <: Any] >: Nothing <: Any, C >: Nothing <: Any]( fa: FoldableK.this.F[A, C] ) def foldMapK[B >: Nothing <: Any](f: perspective.~>#:[A, B])(using B: cats.Monoid[B] ): B = this.foldLeftK[A, C](fa)[B](B.empty)( { def $anonfun(b: B): A ~>#: B = { final class $anon() extends Object(), PolyFunction { def apply[Z >: Nothing <: Any](az: A[Z]): B = cats.syntax.all.catsSyntaxSemigroup[B](b)(B).combine( f.apply[Z](az) ) } new $anon():([Z] => (A[Z]) => B) } closure($anonfun) } ) extension [A >: Nothing <: Any, C >: Nothing <: Any]( fa: FoldableK.this.F[perspective.Const[A], C] ) def toListK: List[A] = this.foldMapK[([_] =>> A), C](fa)[perspective.Const[List[A]][Z]]( perspective.FunctionK.liftConst[A, List[A]]( { def $anonfun(_$5: A): List[A] = List.apply[A]([_$5:A : A]*) closure($anonfun) } ) )(cats.kernel.Semigroup.catsKernelMonoidForList[A]) } error when pickling tree package perspective { import cats.* import cats.syntax.package.all.* import scala.language.implicitConversions @sourcefile("dotty/perspective/src/main/scala/perspective/FoldableK.scala") trait FoldableK[ F[_[_ >: Nothing <: Any] >: Nothing <: Any, _ >: Nothing <: Any] >: Nothing <: Any ]() extends Object { F[_$1[_$2],_$3] extension [A[_ >: Nothing <: Any] >: Nothing <: Any, C >: Nothing <: Any]( fa: FoldableK.this.F[A, C] ) def foldLeftK[B >: Nothing <: Any](b: B)(f: B => A ~>#: B): B extension [A[_ >: Nothing <: Any] >: Nothing <: Any, C >: Nothing <: Any]( fa: FoldableK.this.F[A, C] ) def foldMapK[B >: Nothing <: Any](f: perspective.~>#:[A, B])(using B: cats.Monoid[B] ): B = this.foldLeftK[A, C](fa)[B](B.empty)( { def $anonfun(b: B): A ~>#: B = { final class $anon() extends Object(), PolyFunction { def apply[Z >: Nothing <: Any](az: A[Z]): B = cats.syntax.all.catsSyntaxSemigroup[B](b)(B).combine( f.apply[Z](az) ) } new $anon():([Z] => (A[Z]) => B) } closure($anonfun) } ) extension [A >: Nothing <: Any, C >: Nothing <: Any]( fa: FoldableK.this.F[perspective.Const[A], C] ) def toListK: List[A] = this.foldMapK[([_] =>> A), C](fa)[perspective.Const[List[A]][Z]]( perspective.FunctionK.liftConst[A, List[A]]( { def $anonfun(_$5: A): List[A] = List.apply[A]([_$5:A : A]*) closure($anonfun) } ) )(cats.kernel.Semigroup.catsKernelMonoidForList[A]) } } java.lang.AssertionError: assertion failed: orphan parameter reference: TypeParamRef(Z) while compiling /Users/odersky/workspace/dotty/community-build/community-projects/perspective/dotty/perspective/src/main/scala/perspective/ApplicativeK.scala, /Users/odersky/workspace/dotty/community-build/community-projects/perspective/dotty/perspective/src/main/scala/perspective/ApplyK.scala, /Users/odersky/workspace/dotty/community-build/community-projects/perspective/dotty/perspective/src/main/scala/perspective/Compose.scala, /Users/odersky/workspace/dotty/community-build/community-projects/perspective/dotty/perspective/src/main/scala/perspective/Const.scala, /Users/odersky/workspace/dotty/community-build/community-projects/perspective/dotty/perspective/src/main/scala/perspective/DistributiveK.scala, /Users/odersky/workspace/dotty/community-build/community-projects/perspective/dotty/perspective/src/main/scala/perspective/Finite.scala, /Users/odersky/workspace/dotty/community-build/community-projects/perspective/dotty/perspective/src/main/scala/perspective/FoldableK.scala, /Users/odersky/workspace/dotty/community-build/community-projects/perspective/dotty/perspective/src/main/scala/perspective/FunctionK.scala, /Users/odersky/workspace/dotty/community-build/community-projects/perspective/dotty/perspective/src/main/scala/perspective/FunctorK.scala, /Users/odersky/workspace/dotty/community-build/community-projects/perspective/dotty/perspective/src/main/scala/perspective/Id.scala, /Users/odersky/workspace/dotty/community-build/community-projects/perspective/dotty/perspective/src/main/scala/perspective/MonadK.scala, /Users/odersky/workspace/dotty/community-build/community-projects/perspective/dotty/perspective/src/main/scala/perspective/RepresentableK.scala, /Users/odersky/workspace/dotty/community-build/community-projects/perspective/dotty/perspective/src/main/scala/perspective/TraverseK.scala, /Users/odersky/workspace/dotty/community-build/community-projects/perspective/dotty/perspective/src/main/scala/perspective/TupleK.scala, /Users/odersky/workspace/dotty/community-build/community-projects/perspective/dotty/perspective/src/main/scala/perspective/ValueK.scala [error] ## Exception when compiling 15 sources to /Users/odersky/workspace/dotty/community-build/community-projects/perspective/dotty/perspective/target/scala-3.1.1-RC1-bin-SNAPSHOT/classes [error] java.lang.AssertionError: assertion failed: orphan parameter reference: TypeParamRef(Z) [error] scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8) [error] dotty.tools.dotc.core.tasty.TreePickler.pickleNewType(TreePickler.scala:289) [error] dotty.tools.dotc.core.tasty.TreePickler.pickleType(TreePickler.scala:160) [error] dotty.tools.dotc.core.tasty.TreePickler.pickleNewType$$anonfun$11$$anonfun$1(TreePickler.scala:181) [error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:15) [error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:10) [error] scala.collection.immutable.List.foreach(List.scala:333) [error] dotty.tools.dotc.core.tasty.TreePickler.pickleNewType$$anonfun$2(TreePickler.scala:181) [error] dotty.tools.dotc.core.tasty.TreePickler.withLength(TreePickler.scala:58) [error] dotty.tools.dotc.core.tasty.TreePickler.pickleNewType(TreePickler.scala:181) [error] dotty.tools.dotc.core.tasty.TreePickler.pickleType(TreePickler.scala:160) [error] dotty.tools.dotc.core.tasty.TreePickler.pickleTree(TreePickler.scala:604) [error] dotty.tools.dotc.core.tasty.TreePickler.pickleTpt(TreePickler.scala:316) [error] dotty.tools.dotc.core.tasty.TreePickler.pickleTree$$anonfun$39$$anonfun$1(TreePickler.scala:435) [error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:15) [error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:10) ``` This looks like an unrelated problem that was exposed by the fix to `subsumes`. Unfortunately it's too large a project for me to troubleshoot myself. So we'd need a minimization to get to the root of it.
armanbilge
added a commit
to armanbilge/schrodinger
that referenced
this pull request
Oct 10, 2021
Depends on scala/scala3#13650 Partially revert "Get tests compiling/passing again" This partially reverts commit 690fb41.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The test gave a false negative in the case where a parameter was
instantiated to the same value in both constraints. In that case
the parameter is not "contained" in either constraint, since it
is already instantiated, and that caused the test to fail.
Fixes #13541