fix(frontends/lean/decl_cmds): missing condition

This commit is contained in:
Leonardo de Moura 2015-04-21 21:08:57 -07:00
parent 22f6a95cc4
commit caf28f4053

View file

@ -172,9 +172,9 @@ optional<binder_info> parse_binder_info(parser & p, variable_kind k) {
}
static void check_variable_kind(parser & p, variable_kind k) {
if (in_context(p.env())) {
if (in_context(p.env()) || in_section(p.env())) {
if (k == variable_kind::Axiom || k == variable_kind::Constant)
throw parser_error("invalid declaration, 'constant/axiom' cannot be used in contexts",
throw parser_error("invalid declaration, 'constant/axiom' cannot be used in sections/contexts",
p.pos());
} else if (!in_section(p.env()) && !in_context(p.env()) && k == variable_kind::Parameter) {
throw parser_error("invalid declaration, 'parameter/hypothesis/conjecture' "