Open pmeheut opened 1 year ago
Open CB failures of zio/zio-config might be related to that. It fails with same error in 3.3.1-RC3: https://github.com/VirtusLab/community-build3/actions/runs/5480083582/jobs/9985438703 However, it compiles in 3.3.2-RC1 Nightly, but fails with different error https://github.com/VirtusLab/community-build3/actions/runs/5426571795/jobs/9871306636
I think it might be rather a regression in one of used libraries, if I need to guess, then I'd bet on import io.circe.generic.auto.*
which might generate a new typeclass for each found usage of given type
And if fact it matches a source code for that version: https://github.com/circe/circe/blob/505fa69c73306ce98b67f4d224799774a5ba3e67/modules/core/shared/src/main/scala-3/io/circe/Derivation.scala#L16-L17
What's interesting this Derivation is deprecated since 0.14.4, so they're probably aware of this kind of issues, however the given snippet would still fail to compile even when using latest versions of libraries. There no version of Scala 3 in which it would successfully compile
I believe the relevant circe issue is https://github.com/circe/circe/issues/2126, I'm not sure if there's actually something we can do differently in the compiler since we don't know what the inline def is trying to achieve in general so it's hard for us to give more precise error messages. perhaps we could let the authors of the inline def customize the error that is reported in cases like this, but full auto derivation is just the wrong default in circe.
Thanks. Now I understand. Because Caliban 2.2.0 moved from Circe to jsoniter, GraphQLRequest and other classes do not provide the implicit Circe encoders/decoders anymore. So the compiler tries full auto-derivation and fails.
This is not obvious.
It's not the compiler that tries that, it's the type class derivation macro library that circe uses (kitten, maybe?). Once we move to Scala 3 built in typeclass derivation, it will be up the the compiler. And hopefully that will be more predictable..
, it's the type class derivation macro library that circe uses (kitten, maybe?).
circe implements typeclass derivation for scala 3 by itself via inline defs: https://github.com/circe/circe/blob/series/0.14.x/modules/core/shared/src/main/scala-3/io/circe/derivation/package.scala
Once we move to Scala 3 built in typeclass derivation, it will be up the the compiler.
Is this referring to an upcoming feature?
Ah indeed. Not sure why it tried to call itself in a cycle then.
What is the definition ofGraphQLRequest
? - edit: I found it and i dont that is relevant to this issue
You can also try -Xprint:inlining
to try and see the trees that get inlined
With caliban 2.0.0, the code compiles and works. With 2.2.0, it fails and the recursive error message is not helpful at all.
Compiler version
3.3.0
Minimized example
build.sbt
Expectation
At least an usable error message pointed out the source of the problem in the code because increasing -Xmax-inlines has no effect.