diff options
| author | Lindsey Kuper <[email protected]> | 2011-03-29 15:51:53 -0700 |
|---|---|---|
| committer | Lindsey Kuper <[email protected]> | 2011-03-29 15:59:15 -0700 |
| commit | 55fbed3d8d7078bfd3864e64cc044cbe876c5d1a (patch) | |
| tree | 3c0a53f8f59dbda781fda2a7ad1e5afcce719de2 /src/comp/middle | |
| parent | Ignore 'mutable foo' in plain field contexts. (diff) | |
| download | rust-55fbed3d8d7078bfd3864e64cc044cbe876c5d1a.tar.xz rust-55fbed3d8d7078bfd3864e64cc044cbe876c5d1a.zip | |
Beginnings of support for magical self prefix; nothing profound happening yet.
Diffstat (limited to 'src/comp/middle')
| -rw-r--r-- | src/comp/middle/ty.rs | 1 | ||||
| -rw-r--r-- | src/comp/middle/typeck.rs | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index f9822d97..d1d7c5e3 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -757,6 +757,7 @@ fn expr_ty(@ast.expr expr) -> @t { case (ast.expr_rec(_, _, ?ann)) { ret ann_to_type(ann); } case (ast.expr_bind(_, _, ?ann)) { ret ann_to_type(ann); } case (ast.expr_call(_, _, ?ann)) { ret ann_to_type(ann); } + case (ast.expr_call_self(_, _, ?ann)) { ret ann_to_type(ann); } case (ast.expr_spawn(_, _, _, _, ?ann)) { ret ann_to_type(ann); } case (ast.expr_binary(_, _, _, ?ann)) { ret ann_to_type(ann); } diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs index cdb61cbd..daab4b49 100644 --- a/src/comp/middle/typeck.rs +++ b/src/comp/middle/typeck.rs @@ -1312,6 +1312,13 @@ fn demand_expr_full(&@fn_ctxt fcx, @ty.t expected, @ast.expr e, ann_to_type(ann), adk); e_1 = ast.expr_call(sube, es, ast.ann_type(t, none[vec[@ty.t]])); } + case (ast.expr_call_self(?sube, ?es, ?ann)) { + auto t = demand_full(fcx, e.span, expected, + ann_to_type(ann), adk); + e_1 = ast.expr_call_self(sube, + es, + ast.ann_type(t, none[vec[@ty.t]])); + } case (ast.expr_binary(?bop, ?lhs, ?rhs, ?ann)) { auto t = demand(fcx, e.span, expected, ann_to_type(ann)); e_1 = ast.expr_binary(bop, lhs, rhs, |