fix(library/scoped_ext): section/context should not affect namespace
This commit is contained in:
parent
f9b62c53e6
commit
2631979f5c
2 changed files with 12 additions and 1 deletions
|
@ -99,7 +99,9 @@ static std::string g_new_namespace_key("nspace");
|
|||
environment push_scope(environment const & env, io_state const & ios, scope_kind k, name const & n) {
|
||||
if (k == scope_kind::Namespace && in_section_or_context(env))
|
||||
throw exception("invalid namespace declaration, a namespace cannot be declared inside a section or context");
|
||||
name new_n = get_namespace(env) + n;
|
||||
name new_n = get_namespace(env);
|
||||
if (k == scope_kind::Namespace)
|
||||
new_n = new_n + n;
|
||||
scope_mng_ext ext = get_extension(env);
|
||||
bool save_ns = false;
|
||||
if (!ext.m_namespace_set.contains(new_n)) {
|
||||
|
|
9
tests/lean/run/sec_bug.lean
Normal file
9
tests/lean/run/sec_bug.lean
Normal file
|
@ -0,0 +1,9 @@
|
|||
import logic
|
||||
|
||||
namespace foo
|
||||
section bla
|
||||
definition tst := true
|
||||
end bla
|
||||
end foo
|
||||
|
||||
check foo.tst
|
Loading…
Reference in a new issue