Skip to content

Commit a83116c

Browse files
committed
---
yaml --- r: 1568 b: refs/heads/master c: 50da3ea h: refs/heads/master v: v3
1 parent 7a0063b commit a83116c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: b828ec36fb6d1b6ef5b41d8366287e0b38b4da2e
2+
refs/heads/master: 50da3ea5bcf31d3c4784f2e5158fd1e7d74aa2d6

trunk/src/comp/middle/typeck.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1461,6 +1461,12 @@ fn check_pat(&@fn_ctxt fcx, @ast.pat pat) -> @ast.pat {
14611461
auto t = fcx.ccx.item_types.get(vdef._1);
14621462
auto len = _vec.len[ast.ident](p.node.idents);
14631463
auto last_id = p.node.idents.(len - 1u);
1464+
1465+
auto ty_params = fcx.ccx.item_ty_params.get(vdef._0);
1466+
auto tag_ty = fcx.ccx.item_types.get(vdef._0);
1467+
auto tpt = tup(some(ty_params), tag_ty);
1468+
auto ann = instantiate_path(fcx, p, tpt, pat.span);
1469+
14641470
alt (t.struct) {
14651471
// N-ary variants have function types.
14661472
case (ty.ty_fn(_, ?args, ?tag_ty)) {
@@ -1483,14 +1489,11 @@ fn check_pat(&@fn_ctxt fcx, @ast.pat pat) -> @ast.pat {
14831489
new_subpats += vec(check_pat(fcx, subpat));
14841490
}
14851491

1486-
auto ann = ast.ann_type(tag_ty, none[vec[@ty.t]]);
14871492
new_pat = ast.pat_tag(p, new_subpats, vdef_opt, ann);
14881493
}
14891494

14901495
// Nullary variants have tag types.
14911496
case (ty.ty_tag(?tid, _)) {
1492-
// TODO: ty params
1493-
14941497
auto subpats_len = _vec.len[@ast.pat](subpats);
14951498
if (subpats_len > 0u) {
14961499
// TODO: pluralize properly
@@ -1504,9 +1507,6 @@ fn check_pat(&@fn_ctxt fcx, @ast.pat pat) -> @ast.pat {
15041507
fail; // TODO: recover
15051508
}
15061509

1507-
let vec[@ty.t] tys = vec(); // FIXME
1508-
auto ann = ast.ann_type(plain_ty(ty.ty_tag(tid, tys)),
1509-
none[vec[@ty.t]]);
15101510
new_pat = ast.pat_tag(p, subpats, vdef_opt, ann);
15111511
}
15121512
}

0 commit comments

Comments
 (0)