Skip to content

Commit cb61f10

Browse files
committed
---
yaml --- r: 2521 b: refs/heads/master c: 23d3b0e h: refs/heads/master i: 2519: d102e81 v: v3
1 parent 6e7ccb2 commit cb61f10

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
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: 0739849e9fe9013d87ec6bc7f026143a10079703
2+
refs/heads/master: 23d3b0ec57e5dde910d0fbb5dc84dcd9c0d62024

trunk/src/comp/middle/ty.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,12 @@ fn ann_to_type_params(&node_type_table ntt, &ast::ann ann) -> vec[t] {
14681468
}
14691469
}
14701470

1471+
fn ann_has_type_params(&node_type_table ntt, &ast::ann ann) -> bool {
1472+
auto tpt = ann_to_ty_param_substs_opt_and_ty(ntt, ann);
1473+
ret !option::is_none[vec[t]](tpt._0);
1474+
}
1475+
1476+
14711477
// Returns the type of an annotation, with type parameter substitutions
14721478
// performed if applicable.
14731479
fn ann_to_monotype(ctxt cx, &node_type_table ntt, ast::ann a) -> t {
@@ -1712,13 +1718,7 @@ fn expr_ty_params_and_ty(&ctxt cx, &node_type_table ntt, &@ast::expr expr)
17121718
}
17131719

17141720
fn expr_has_ty_params(&node_type_table ntt, &@ast::expr expr) -> bool {
1715-
// FIXME: Rewrite using complex patterns when they're trustworthy.
1716-
alt (expr_ann(expr)) {
1717-
case (ast::ann_none(_)) { fail; }
1718-
case (ast::ann_type(_, _, ?tps_opt, _)) {
1719-
ret !option::is_none[vec[t]](tps_opt);
1720-
}
1721-
}
1721+
ret ann_has_type_params(ntt, expr_ann(expr));
17221722
}
17231723

17241724
// FIXME: At the moment this works only for call, bind, and path expressions.

0 commit comments

Comments
 (0)