mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-21 02:31:50 +03:00
d94b86e62c
The namespace parser was not requiring a minimum indentation and instead based its indentation on the following line, which meant that a line like: namespace Foo foodef : Int placed foodef into namespace Foo instead of the module's top level. And so made it unclear when a namespace ends.
16 lines
494 B
Idris
16 lines
494 B
Idris
-- Namespaces are currently allowed to be empty, as modules are, but also
|
|
-- require their contents to be indented to denote where they end.
|
|
-- Whereas a module's end is the end of the file.
|
|
|
|
-- Since there's no indentation on the latter definitions, this file should have
|
|
-- Test in scope under Main.X.Test, Test in scope under Main.Test, and nothing
|
|
-- in scope in Main.Y because namespace Y ends immediately.
|
|
|
|
namespace X
|
|
private
|
|
data Test = A | B
|
|
|
|
namespace Y
|
|
private
|
|
data Test = A | B
|