Skip to content

Commit ff6864a

Browse files
author
Rafael Avila de Espindola
committed
Fix expressions with paths with more than one element.
1 parent 8122e0c commit ff6864a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/comp/middle/resolve.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,7 @@ fn fold_expr_path(&env e, &span sp, &ast.path p, &option.t[def] d,
432432
path_len = n_idents - remaining + 1u;
433433
}
434434
case (def_wrap_other(_)) {
435-
check (n_idents == 1u);
436-
path_len = 1u;
435+
path_len = n_idents;
437436
}
438437
case (def_wrap_mod(?m)) {
439438
e.sess.span_err(sp,

src/test/run-pass/path.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
mod foo {
2+
fn bar(uint offset) {
3+
}
4+
}
5+
6+
fn main(vec[str] args) {
7+
foo.bar(0u);
8+
}

0 commit comments

Comments
 (0)