test(tests/lean/eq_class_error): save "workaround" for cryptic error message

This commit is contained in:
Leonardo de Moura 2015-05-03 21:05:32 -07:00
parent 3cd8f38b8d
commit b347f4868b
2 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,15 @@
inductive foo :=
| a | b
open foo
-- This test demonstrates we need to disable local instances.
set_option elaborator.local_instances false
definition decidable_eq_foo [instance] : ∀ f₁ f₂ : foo, decidable (f₁ = f₂)
| a a := by left; reflexivity
| a b := by right; contradiction
| b a := by right; contradiction
-- If we don't disable the local_instances, then type class resolution synthesizes the term (decidable_eq_foo b b) which is not a
-- valid "recursive application", and the recursive equation compiler fails with a cryptic message saying we should try to use well-founded recursion.
| b b := _

View file

@ -0,0 +1,7 @@
eq_class_error.lean:15:10: error: don't know how to synthesize placeholder
decidable_eq_foo : Π (f₁ f₂ : foo), decidable (f₁ = f₂)
⊢ decidable (b = b)
eq_class_error.lean:9:11: error: failed to synthesize placeholder
⊢ Π (f₁ f₂ : foo),
decidable (f₁ = f₂)