lean2/tests/lean/t3.lean
2014-06-13 11:34:43 -07:00

37 lines
1 KiB
Text

universe u
print raw Type.{u}
namespace tst
universe v
print raw Type.{v}
print raw Type.{tst.v}
end
print raw Type.{tst.v}
print raw Type.{v} -- Error: alias 'v' is not available anymore
section
universe z -- Remark: this is a local universe
print raw Type.{z}
end
print raw Type.{z} -- Error: local universe 'z' is gone
section
namespace foo -- Error: we cannot create a namespace inside a section
end
namespace tst
print raw Type.{v} -- Remark: alias 'v' is available again
print raw Type.{u}
namespace foo
universe U
end
end
print raw Type.{tst.foo.U}
namespace tst.foo -- Error: we cannot use qualified names in declarations
universe full.name.U -- Error: we cannot use qualified names in declarations
namespace tst
namespace foo
print raw Type.{v} -- Remark: alias 'v' for 'tst.v' is available again
print raw Type.{U} -- Remark: alias 'U' for 'tst.foo.U' is available again
end
end
namespace bla
universe u -- Error: we cannot shadow universe levels
end
print raw Type.{bla.u} -- Error: we failed to declare bla.u