We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I just noticed that Hash[() => A] doesn't match hashCode, and (possibly worse) it evaluates the function:
Hash[() => A]
hashCode
scala> val thunk = () => "abcd" thunk: () => String = $$Lambda$4719/1999191506@1ef9f59 scala> thunk.hashCode res0: Int = 32481113 scala> import cats.implicits._ import cats.implicits._ scala> thunk.hash res1: Int = 2987074 scala> "abcd".hashCode res2: Int = 2987074
We should decide whether / how to handle this and add something like this to LawTests in the kernel-laws tests:
LawTests
checkAll("Hash[() => Int]", HashTests[() => Int].hash)
(I confirmed that it fails now.)
The text was updated successfully, but these errors were encountered:
Any reason why this is closed?
Sorry, something went wrong.
@kailuowang I'm not sure it's unintended / not the right behavior. Will take a closer look tomorrow.
thanks! FWIW, this is the PR that added the code. #1712
No branches or pull requests
I just noticed that
Hash[() => A]
doesn't matchhashCode
, and (possibly worse) it evaluates the function:We should decide whether / how to handle this and add something like this to
LawTests
in the kernel-laws tests:(I confirmed that it fails now.)
The text was updated successfully, but these errors were encountered: