-
-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
It seems my instances for ZoneId and ZoneOffset are slightly broken. When importing io.chrisdavenport.cats.time.instances.all._, I get a conflict when trying to show a ZoneOffset:
scala> show"${ZoneOffset.UTC}"
<console>:22: error: type mismatch;
found : java.time.ZoneOffset
required: cats.Show.Shown
show"${ZoneOffset.UTC}"
^
This arises because there are two overlapping instances for ContravariantShow[-T]:
scala> Show.Shown.mat(ZoneOffset.UTC)
<console>:22: error: ambiguous implicit values:
both value zoneidInstances in trait zoneid of type => cats.Show[java.time.ZoneId] with cats.Eq[java.time.ZoneId] with cats.Hash[java.time.ZoneId]
and value zoneoffsetInstances in trait zoneoffset of type => cats.Show[java.time.ZoneOffset] with cats.Order[java.time.ZoneOffset] with cats.Hash[java.time.ZoneOffset]
match expected type cats.Show.ContravariantShow[java.time.ZoneOffset]
Show.Shown.mat(ZoneOffset.UTC)
^
, and the compiler can't choose a better one.
I'm not sure what would be the best course of action here. Removing Show[ZoneOffset] would fix interpolation, however most of generic code I've seen relies directly on Show!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels