Skip to content

Commit c3f803f

Browse files
committed
---
yaml --- r: 1305 b: refs/heads/master c: c170e7e h: refs/heads/master i: 1303: 170fbe5 v: v3
1 parent f965b21 commit c3f803f

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 21208f23439acfae35e615abbe791b3011b950bc
2+
refs/heads/master: c170e7edfdfe156f11374d5e3c265b613351dc99

trunk/src/comp/middle/resolve.rs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -486,25 +486,10 @@ fn fold_view_item_import(&env e, &span sp,
486486
}
487487

488488
fn fold_ty_path(&env e, &span sp, ast.path p, &option.t[def] d) -> @ast.ty {
489+
auto index = new_def_hash[def_wrap]();
490+
auto d = find_final_def(e, index, sp, p.node.idents, none[ast.def_id]);
489491

490-
let uint len = _vec.len[ast.ident](p.node.idents);
491-
check (len != 0u);
492-
if (len > 1u) {
493-
e.sess.unimpl("resolving path ty with >1 component");
494-
}
495-
496-
auto d_ = lookup_name(e, p.node.idents.(0));
497-
498-
alt (d_) {
499-
case (some[def](?d)) {
500-
// log "resolved name " + p.node.idents.(0);
501-
}
502-
case (none[def]) {
503-
e.sess.span_err(sp, "unresolved name: " + p.node.idents.(0));
504-
}
505-
}
506-
507-
ret @fold.respan[ast.ty_](sp, ast.ty_path(p, d_));
492+
ret @fold.respan[ast.ty_](sp, ast.ty_path(p, some(unwrap_def(d))));
508493
}
509494

510495
fn update_env_for_crate(&env e, @ast.crate c) -> env {

trunk/src/test/run-pass/alt-path.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import m1.foo;
21
mod m1 {
32
tag foo {
43
foo1;
54
foo2;
65
}
76
}
8-
fn bar(foo x) {
7+
fn bar(m1.foo x) {
98
alt(x) {
109
case (m1.foo1) {
1110
}

0 commit comments

Comments
 (0)