You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
It seems my instances for
ZoneId
andZoneOffset
are slightly broken. When importingio.chrisdavenport.cats.time.instances.all._
, I get a conflict when trying toshow
aZoneOffset
:This arises because there are two overlapping instances for
ContravariantShow[-T]
:, 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 onShow
!The text was updated successfully, but these errors were encountered: