-
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
kittens instance not found in 3.4.0 without -source:3.3 #19835
Comments
workaround: import scala.language.`3.3` sounds like kittens has some Here is the release notes of 3.4
|
I got this error anyway: scala> import cats.kernel.Monoid
| import cats.derived.auto.monoid.given
|
| case class B(a: Option[Int])
| case class A(b: Option[B])
|
| val _ = Monoid[A].empty
-- [E172] Type Error: ----------------------------------------------------------
7 |val _ = Monoid[A].empty
| ^
|No given instance of type cats.derived.DerivedMonoid[A] was found.
|I found:
|
| cats.derived.DerivedMonoid.given_DerivedMonoid_A[A](
| {
| val gen$proxy1:
|
| scala.deriving.Mirror.Product{
| type Kind = shapeless3.deriving².K0.type; type MirroredType = A;
| type MirroredMonoType = A; type MirroredElemTypes <: Tuple
| }
| &
| scala.deriving.Mirror.Product{
| type MirroredMonoType = A; type MirroredType = A;
| type MirroredLabel = ("A" : String);
| type MirroredElemTypes = Option[B] *: EmptyTuple.type;
| type MirroredElemLabels = ("b" : String) *: EmptyTuple.type
| }
|
| =
| A.$asInstanceOf[
|
| scala.deriving.Mirror.Product{
| type Kind = shapeless3.deriving².K0.type; type MirroredType = A;
| type MirroredMonoType = A; type MirroredElemTypes <: Tuple
| }
| &
| scala.deriving.Mirror.Product{
| type MirroredMonoType = A; type MirroredType = A;
| type MirroredLabel = ("A" : String);
| type MirroredElemTypes = Option[B] *: EmptyTuple.type;
| type MirroredElemLabels = ("b" : String) *: EmptyTuple.type
| }
|
| ]
| shapeless3.deriving².internals.ErasedProductInstances1.apply[
| shapeless3.deriving².K0.type,
| cats.derived.Derived.Or[cats.kernel.Monoid[A]]](gen$proxy1,
| scala.compiletime.summonInline[
| cats.derived.Derived.Or[cats.kernel.Monoid[Option[B]]]]:Any
| ):
| shapeless3.deriving².internals.ErasedProductInstances[
| shapeless3.deriving².K0.type,
| cats.derived.Derived.Or[cats.kernel.Monoid[A]]]
| :
| shapeless3.deriving².K0.ProductInstances[
| [A²] =>> cats.derived.Derived.Or[cats.kernel.Monoid[A²]], A]
| }
| )
|
|But given instance mkProductInstances in object K0 does not match type => shapeless3.deriving².K0.ProductInstances[cats.derived.DerivedMonoid.Or, A]
|
|where: A is a class in the empty package
| A² is a type variable with constraint
| deriving is a package in package scala
| deriving² is a package in package shapeless3
|.
|
|The following import might make progress towards fixing the problem:
|
| import cats.derived.DerivedMonoid.Strict.product
|
|---------------------------------------------------------------------------
|Inline stack trace
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|This location contains code that was inlined from DerivedMonoid.scala:18
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|This location contains code that was inlined from DerivedMonoid.scala:18
---------------------------------------------------------------------------
1 error found |
Type inference has changed how? |
see here #19253 |
I really don't follow what's the issue. Here is the definition of inline given mkProductInstances[F[_], T](using gen: ProductGeneric[T]): ProductInstances[F, T] =
ErasedProductInstances[K0.type, F[T], LiftP[F, gen.MirroredElemTypes]](gen) This that it doesn't match is simply not true:
|
Btw, are there any instructions how to a project to the community build? I tried to do it but it didn't work. |
maybe you can look at this PR which handles source dependencies: #10639 |
fwiw, there's been talk internally recently about making the open community build results easier for library maintainers to find and monitor. I hope that will happen now that the open community build (https://github.com/VirtusLab/community-build3) is in such robust shape, it's unclear to me whether further additions to the small in-repo community build are desired. these repos are part of PR validation, which helps catch problems early, but just throwing projects in willy-nilly doesn't scale; not sure what the current happy medium is considered to be @joroKr21 at minimum, you should check the kittens entry at https://github.com/VirtusLab/community-build3/blob/master/.github/workflows/buildConfig.json to see if it looks appropriate |
Thanks, the kittens build is indeed running and is red but I didn't know about it |
There is a new version of typelevel/kittens 3.3.0 which fixes the issue. |
Compiler version
3.4.0
Minimized code
Output
Expectation
Compiles fine in 3.3.3
The text was updated successfully, but these errors were encountered: