fix(library/scoped_ext): bug when declaring nested namespaces
This commit is contained in:
parent
df008dc3c3
commit
c7406d6ce8
3 changed files with 9 additions and 1 deletions
|
@ -129,7 +129,7 @@ environment push_scope(environment const & env, io_state const & ios, scope_kind
|
|||
r = std::get<3>(t)(r, k);
|
||||
}
|
||||
if (k == scope_kind::Namespace)
|
||||
r = using_namespace(r, ios, n);
|
||||
r = using_namespace(r, ios, new_n);
|
||||
if (save_ns)
|
||||
r = module::add(r, *g_new_namespace_key, [=](serializer & s) { s << new_n; });
|
||||
return r;
|
||||
|
|
7
tests/lean/namespace_bug.lean
Normal file
7
tests/lean/namespace_bug.lean
Normal file
|
@ -0,0 +1,7 @@
|
|||
import data.nat.basic
|
||||
|
||||
namespace playground
|
||||
namespace nat
|
||||
check 2+3 -- Should produce error
|
||||
end nat
|
||||
end playground
|
1
tests/lean/namespace_bug.lean.expected.out
Normal file
1
tests/lean/namespace_bug.lean.expected.out
Normal file
|
@ -0,0 +1 @@
|
|||
namespace_bug.lean:5:7: error: invalid expression
|
Loading…
Reference in a new issue