Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions tests/elabissues/nested_namespace_vs_prefix.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/-
@rwbarton found the following surprising:
-/

-- 1. When you are in `A.B`, you are not in `A`.

def A.foo : String := "A.foo"

namespace A.B

def bar : String := foo -- error: unknown identifier 'foo'

end A.B

namespace A
namespace B

def bar : String := foo -- succeeds

end B
end A

/-
I (@dselsam) agree it is a little weird, and suggest
either we disallow the first case or we make it sugar for the second.
-/