Skip to content

Commit

Permalink
Remove weird warning
Browse files Browse the repository at this point in the history
  • Loading branch information
guizmaii committed Aug 10, 2023
1 parent ce7659b commit 170b5f8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/shared/src/main/scala/zio/prelude/Equal.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import zio.Exit.{Failure, Success}
import zio.prelude.coherent.{HashOrd, HashPartialOrd}
import zio.{Cause, Chunk, Exit, FiberId, NonEmptyChunk, StackTrace, Duration => ZIODuration}

import scala.annotation.{implicitNotFound, nowarn}
import scala.annotation.implicitNotFound
import scala.concurrent.duration.{Duration => ScalaDuration}
import scala.util.Try
import scala.{math => sm}
Expand Down Expand Up @@ -862,9 +862,8 @@ object Equal extends EqualVersionSpecific {
* `Hash` and `Ord` (and thus also `Equal`) instance for `Unit` values.
* Since there is only one `Unit` value all equality comparisons will always be true.
*/
@nowarn("msg=dubious usage of method hashCode with unit value")
implicit val UnitHashOrd: Hash[Unit] with Ord[Unit] =
HashOrd.make(_.hashCode, (_, _) => Ordering.Equals, (_, _) => true)
implicit lazy val UnitHashOrd: Hash[Unit] with Ord[Unit] =
HashOrd.make(Hash.default.hash, (_, _) => Ordering.Equals, (_, _) => true)

/**
* Derives an `Equal[Vector[A]]` given an `Equal[A]`.
Expand Down

0 comments on commit 170b5f8

Please sign in to comment.