-
Notifications
You must be signed in to change notification settings - Fork 64
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
[Scala 3] - Wildcard derivation import not working #425
Comments
Another example that adds import cats.{ Eq, Show }
// import cats.derived.semiauto.{ derived, product, productOrder } // this works
import cats.derived.semiauto.* // does not work
enum ForecastTag derives Eq, Show:
case Long, Short Fails with the following error:
|
There are a few other (probably related) issues with |
Ok, the first one is simply fixed with this import import cats.derived.semiauto.{ given, * } The second and the latter still do not work, though. |
Hmmm this for some reason does not compile locally: import cats.{ Eq, Show }
import cats.derived.semiauto.{ given, * }
import cats.syntax.all.*
enum TradingStatus derives Eq, Show:
case On, Off
object TradingStatus:
def from(str: String): Option[TradingStatus] =
Either.catchNonFatal(valueOf(str)).toOption Fails with this error: [error] -- Error: /home/gvolpe/workspace/trading/modules/domain/src/main/scala/trading/domain/TradingStatus.scala:8:27
[error] 8 |enum TradingStatus derives Eq, Show:
[error] | ^
[error] |ambiguous implicit arguments: both given instance productOrder in trait OrderDerivation and given instance productHash in trait HashDerivation match type cats.kernel.Eq[(trading.domain.TradingStatus.On : trading.domain.TradingStatus)]
[error] | This location contains code that was inlined from deriving.scala:35
[error] | This location contains code that was inlined from deriving.scala:30
[error] | This location contains code that was inlined from erased.scala:301
[error] | This location contains code that was inlined from kinds.scala:149
[error] | This location contains code that was inlined from eq.scala:24
[error] one error found
[error] one error found
[error] (domain / Compile / compileIncremental) Compilation failed But it compiles just fine on Scastie: https://scastie.scala-lang.org/7Eqo9m1hRNCdhX55GTTBdw I need to dig in more into this. |
Kittens for Scala 3 is not ready yet - I think some functionality is missing / implemented inconsistently in the released version. But we are blocked by a Scala compiler issue: scala/scala3#13406 |
Thanks for the quick reply, @joroKr21 ! I understand it's not ready yet. Are you keeping track of the issues / limitations somewhere else? If not, it's probably a good idea to have them on this repo, no? |
Yeah, I'm just not sure if this is a limitation that applies in general or we just need to get unblocked by fixing that Scala bug and release 😄 |
Got you! Ok, if you don't mind, I'll leave this issue open but will refrain from opening new ones. I was aware of these issues for a while but I thought I should raise it here now that the project where I use Kittens is public 😄 |
Thanks @gvolpe! It's great to have feedback on what else we might need to fix once we're unblocked upstream 😅 |
Let's just go for it and release what we can - even if it's not working perfectly at least people can use it. |
That is awesome, thanks @joroKr21 🤩 |
Super simple reproduction:
It fails with the following error:
https://scastie.scala-lang.org/0q4XaUbJTqibfe78MuyzAA
Not sure whether this has already been discussed or not but I figured it might be better to keep track of it right here.
The text was updated successfully, but these errors were encountered: