lean4-htt/tests/lean/phashmap_inst_coherence.lean
Leonardo de Moura 995136d46b chore: fix test
2021-06-02 10:03:12 -07:00

12 lines
370 B
Text

import Std.Data.PersistentHashMap
open Std
def m : PersistentHashMap Nat Nat :=
let m : PersistentHashMap Nat Nat := {};
m.insert 1 1
def natDiffHash : Hashable Nat :=
⟨fun n => UInt64.ofNat $ n+10⟩
-- The following example should fail since the `Hashable` instance used to create `m` is not `natDiffHash`
#eval @PersistentHashMap.find? Nat Nat _ natDiffHash m 1