lean4-htt/tests/lean/run/1468.lean
Leonardo de Moura fdadada3a9 fix(frontends/lean): fixes #1468
@kha I had to add yet another hack to fix this issue.

In notation declarations, names are resolved at notation declaration time.
So, users do not expect them to be resolved again at tactic execution time.

I addressed this problem by wrapping constants occurring in notation
declarations with a "frozen_name" annotation. This transformation is
only performed if m_in_quote is true.
Then resolve_names_fn at elaborator.cpp will not try to resolve the
names again.

This change broke two other modules. `-` notation for inverting
equations at `rw`, and `calc` expressions inside quotes.
The broke for the same reason. They were not expecting the constants
to be wrapped with an annotation.
2017-03-18 13:48:21 -07:00

17 lines
293 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.

local infix * := _root_.mul
namespace Y
def mul : bool → bool := λ b, b
example (m n : ) : true :=
begin
definev k : := m * n,
definev a : bool := mul tt,
trivial
end
end Y
meta def is_mul : expr → option (expr × expr)
| ```(%%a * %%b) := some (a, b)
| _ := none