Add a regression test that exports can expose unexported items

While those unexported items can't be used by name outside the module in which
they are defined, they can be used as a sort of ADT.
This commit is contained in:
Brian Anderson 2011-05-02 19:42:00 -04:00
parent 9d21cf3b61
commit 764de078e7
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
// This tests that exports can have visible dependencies on things
// that are not exported, allowing for a sort of poor-man's ADT
mod foo {
export f;
export g;
// not exported
tag t {
t1;
}
fn f() -> t {
ret t1;
}
fn g(t v) {
assert v == t1;
}
}
fn main() {
foo.g(foo.f());
}