|
1 |
| -// |
2 |
| -// comp/middle/typeck.rs |
3 |
| -// |
4 |
| - |
5 | 1 | import front.ast;
|
6 | 2 | import front.ast.ann;
|
7 | 3 | import middle.fold;
|
@@ -185,7 +181,8 @@ fn ty_to_str(@ty typ) -> str {
|
185 | 181 |
|
186 | 182 | case (ty_fn(?inputs, ?output)) {
|
187 | 183 | auto f = fn_input_to_str;
|
188 |
| - s = "fn(" + _str.connect(_vec.map[arg,str](f, inputs), ", ") + ")"; |
| 184 | + s = "fn(" + _str.connect(_vec.map[arg,str](f, inputs), |
| 185 | + ", ") + ")"; |
189 | 186 | if (output.struct != ty_nil) {
|
190 | 187 | s += " -> " + ty_to_str(output);
|
191 | 188 | }
|
@@ -604,7 +601,7 @@ fn unify(@ty expected, @ty actual) -> unify_result {
|
604 | 601 | auto result = unify_step(expected_output,
|
605 | 602 | actual_output, bindings);
|
606 | 603 | alt (result) {
|
607 |
| - case (ures_ok(?rty)) { |
| 604 | + case (ures_ok(?rty)) { |
608 | 605 | result_out = rty;
|
609 | 606 | }
|
610 | 607 |
|
@@ -722,7 +719,7 @@ fn check_expr(&@env e, &@ty_table locals, @ast.expr expr) -> @ast.expr {
|
722 | 719 | ret @fold.respan[ast.expr_](expr.span,
|
723 | 720 | ast.expr_lit(lit, ast.ann_type(ty)));
|
724 | 721 | }
|
725 |
| - |
| 722 | + |
726 | 723 | case (_) {
|
727 | 724 | // TODO
|
728 | 725 | ret expr;
|
@@ -855,3 +852,13 @@ fn check_crate(session.session sess, @ast.crate crate) -> @ast.crate {
|
855 | 852 | ret fold.fold_crate[@env](e, fld, result._0);
|
856 | 853 | }
|
857 | 854 |
|
| 855 | +// |
| 856 | +// Local Variables: |
| 857 | +// mode: rust |
| 858 | +// fill-column: 78; |
| 859 | +// indent-tabs-mode: nil |
| 860 | +// c-basic-offset: 4 |
| 861 | +// buffer-file-coding-system: utf-8-unix |
| 862 | +// compile-command: "make -k -C ../.. 2>&1 | sed -e 's/\\/x\\//x:\\//g'"; |
| 863 | +// End: |
| 864 | +// |
0 commit comments