diff options
| author | Rafael Ávila de Espíndola <[email protected]> | 2011-01-14 17:20:14 -0500 |
|---|---|---|
| committer | Rafael Ávila de Espíndola <[email protected]> | 2011-01-14 17:34:00 -0500 |
| commit | 5b9eda4a41a410ffd8529a80c19f499ff856e07f (patch) | |
| tree | 8643c5269b17344e41e66f1ee7658c39ebc2aa7d /src/test | |
| parent | Expand generic info in lval_result. (diff) | |
| download | rust-5b9eda4a41a410ffd8529a80c19f499ff856e07f.tar.xz rust-5b9eda4a41a410ffd8529a80c19f499ff856e07f.zip | |
Fix the import handling in "complex" cases. When looking a.b.c and 'a' is a
module, we should look for 'b' *just* in the module 'a' and then continue
resolving b.c in the environment created by updating *with* a.
Still not 100% correct, but getting there.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/import4.rs | 8 | ||||
| -rw-r--r-- | src/test/run-pass/import6.rs | 15 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/test/compile-fail/import4.rs b/src/test/compile-fail/import4.rs new file mode 100644 index 00000000..f769d6d3 --- /dev/null +++ b/src/test/compile-fail/import4.rs @@ -0,0 +1,8 @@ +// error-pattern: recursive import + +import zed.bar; +import bar.zed; + +fn main(vec[str] args) { + log "loop"; +} diff --git a/src/test/run-pass/import6.rs b/src/test/run-pass/import6.rs new file mode 100644 index 00000000..5e3a9d74 --- /dev/null +++ b/src/test/run-pass/import6.rs @@ -0,0 +1,15 @@ +import bar.baz; +import foo.zed; +mod foo { + mod zed { + fn baz() { + log "baz"; + } + } +} +mod bar { + import zed.baz; +} +fn main(vec[str] args) { + baz(); +} |