Add some tests of tag-export interaction

This commit is contained in:
Brian Anderson 2011-05-02 20:29:11 -04:00
parent cb53065a21
commit 3014a5887d
3 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,17 @@
// xfail-boot
// error-pattern: unresolved name
// Tag variants are not exported with their tags. This allows for a
// simple sort of ADT.
mod foo {
export t;
tag t {
t1;
}
}
fn main() {
auto x = foo.t1;
}

View File

@ -0,0 +1,19 @@
// We can export tags without exporting the variants to create a simple
// sort of ADT.
mod foo {
export t;
export f;
tag t {
t1;
}
fn f() -> t {
ret t1;
}
}
fn main() {
let foo.t v = foo.f();
}

View File

@ -0,0 +1,12 @@
// Export the tag variants, without the tag
mod foo {
export t1;
tag t {
t1;
}
}
fn main() {
auto v = foo.t1;
}