fix(library/scoped_ext): bug when declaring nested namespaces

This commit is contained in:
Leonardo de Moura 2014-11-02 15:35:49 -08:00
parent df008dc3c3
commit c7406d6ce8
3 changed files with 9 additions and 1 deletions

View file

@ -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;

View file

@ -0,0 +1,7 @@
import data.nat.basic
namespace playground
namespace nat
check 2+3 -- Should produce error
end nat
end playground

View file

@ -0,0 +1 @@
namespace_bug.lean:5:7: error: invalid expression