Skip to content

Commit f2fc0f8

Browse files
committed
---
yaml --- r: 1182 b: refs/heads/master c: 771d76e h: refs/heads/master v: v3
1 parent 92815bd commit f2fc0f8

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
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: 0040a31076f750992ad903b2ae2b7a724808f028
2+
refs/heads/master: 771d76e5520bb886624e4541ff3b74f2d6513bd6

trunk/src/comp/middle/ty.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,29 @@ fn count_ty_params(@t ty) -> uint {
518518
ret _vec.len[ast.def_id](*param_ids);
519519
}
520520

521+
// Type accessors for substructures of types
522+
523+
fn ty_fn_args(@t fty) -> vec[arg] {
524+
alt (fty.struct) {
525+
case (ty.ty_fn(?a, _)) { ret a; }
526+
}
527+
}
528+
529+
fn ty_fn_ret(@t fty) -> @t {
530+
alt (fty.struct) {
531+
case (ty.ty_fn(_, ?r)) { ret r; }
532+
}
533+
}
534+
535+
fn is_fn_ty(@t fty) -> bool {
536+
alt (fty.struct) {
537+
case (ty.ty_fn(_, _)) { ret true; }
538+
case (_) { ret false; }
539+
}
540+
ret false;
541+
}
542+
543+
521544
// Type accessors for AST nodes
522545

523546
fn stmt_ty(@ast.stmt s) -> @t {
@@ -552,6 +575,7 @@ fn expr_ty(@ast.expr expr) -> @t {
552575
case (ast.expr_vec(_, ?ann)) { ret ann_to_type(ann); }
553576
case (ast.expr_tup(_, ?ann)) { ret ann_to_type(ann); }
554577
case (ast.expr_rec(_, ?ann)) { ret ann_to_type(ann); }
578+
case (ast.expr_bind(_, _, ?ann)) { ret ann_to_type(ann); }
555579
case (ast.expr_call(_, _, ?ann)) { ret ann_to_type(ann); }
556580
case (ast.expr_binary(_, _, _, ?ann)) { ret ann_to_type(ann); }
557581
case (ast.expr_unary(_, _, ?ann)) { ret ann_to_type(ann); }

0 commit comments

Comments
 (0)