fix(frontends/lean/util): assertion violation

fixes #559
This commit is contained in:
Leonardo de Moura 2015-04-24 15:08:58 -07:00
parent f723550d33
commit 6134c8822a
3 changed files with 20 additions and 2 deletions

View file

@ -126,8 +126,10 @@ void collect_locals(expr const & type, expr const & value, parser const & p, buf
buffer<expr> include_vars;
p.get_include_variables(include_vars);
for (expr const & param : include_vars) {
collect_locals_ignoring_tactics(mlocal_type(param), ls);
ls.insert(param);
if (is_local(param)) {
collect_locals_ignoring_tactics(mlocal_type(param), ls);
ls.insert(param);
}
}
collect_locals_ignoring_tactics(type, ls);
collect_locals_ignoring_tactics(value, ls);

12
tests/lean/559.lean Normal file
View file

@ -0,0 +1,12 @@
import algebra.ordered_field
open algebra
section sequence_c
parameter Q : Type
parameter lof_Q : linear_ordered_field Q
definition to_lof [instance] : linear_ordered_field Q := lof_Q
include to_lof
theorem foo (a b : Q) : a + b = b + a := !add.comm
end sequence_c

View file

@ -0,0 +1,4 @@
559.lean:10:28: error: failed to synthesize placeholder
Q : Type,
a b : Q
⊢ has_add Q