Implement simple module export

This commit is contained in:
Brian Anderson 2011-04-24 19:40:01 -04:00
parent 40624e35d7
commit 459b0ec833
6 changed files with 143 additions and 14 deletions

View file

@ -0,0 +1,19 @@
// xfail-stage0
// error-pattern: unknown module item
// rustboot has a different error message than rustc
// this test can die with rustboot, or rustc's error can change
mod foo {
export x;
fn x(int y) {
log y;
}
fn z(int y) {
log y;
}
}
fn main() {
foo.z(10);
}

View file

@ -1,5 +1,5 @@
// xfail-stage0
// error-pattern: unknown module item
// xfail-boot
// error-pattern: unresolved name
mod foo {
export x;
fn x(int y) {

View file

@ -0,0 +1,25 @@
// xfail-boot
// error-pattern: unresolved name
mod foo {
export x;
fn x() {
bar.x();
}
}
mod bar {
export y;
fn x() {
log "x";
}
fn y() {
}
}
fn main() {
foo.x();
}