about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrian Anderson <andersrb@gmail.com>2011-05-01 16:29:52 -0400
committerBrian Anderson <andersrb@gmail.com>2011-05-01 16:57:36 -0400
commitf25e6783657cde34e25aa8ba105cd43fe9bda787 (patch)
treed0399c78c3e9e5958355126920e6ba8cbbf53b01
parenta6972102342611afb6647b34714556262de1e084 (diff)
Add a regression test for use of unexported fully-qualified paths
An unexported foo.baz can't be resolved from inside foo when called as foo.baz
instead of just baz. This behavior may want to change eventually.
-rw-r--r--src/test/compile-fail/export-fully-qualified.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/compile-fail/export-fully-qualified.rs b/src/test/compile-fail/export-fully-qualified.rs
new file mode 100644
index 00000000000..1f62b0a8178
--- /dev/null
+++ b/src/test/compile-fail/export-fully-qualified.rs
@@ -0,0 +1,21 @@
+// xfail-boot
+// error-pattern: unresolved name
+
+// In this test baz isn't resolved when called as foo.baz even though
+// it's called from inside foo. This is somewhat surprising and may
+// want to change eventually.
+
+mod foo {
+
+  export bar;
+
+  fn bar() {
+    foo.baz();
+  }
+
+  fn baz() {
+  }
+}
+
+fn main() {
+}
\ No newline at end of file