lean4-htt/tests/lean/infoFromFailure.lean
Leonardo de Moura 9c8f57f322 fix: preserve info messages from candidates that failed to be elaborated
@Kha Not sure whether we should have an option for supressing this
information or not.
We need this information for diagnosing problems. For example, I was trying to
understand why the elaborator was looping. I suspected it was the
TC module, but I was not getting any trace messages since the symbol
was overloaded, and the case that did not work was the expensive one :(
2020-09-17 17:08:14 -07:00

18 lines
445 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

new_frontend
def A.foo {α : Type} [HasAdd α] (a : α) : α × α :=
(a, a + a)
def B.foo {α : Type} (a : α) : α × α :=
(a, a)
open A
open B
set_option trace.Meta.synthInstance true
-- `foo` is overloaded, the case `A.foo` is discarded because we don't have an instance `[HasAdd String]`.
-- However, we still want to see the trace since we used trace.Meta.synthInstance
#check foo "hello"
theorem ex : foo true = (true, true) :=
rfl