diff options
| author | Lindsey Kuper <[email protected]> | 2011-04-05 16:17:47 -0700 |
|---|---|---|
| committer | Lindsey Kuper <[email protected]> | 2011-04-05 16:26:31 -0700 |
| commit | 4fc8de196977a0e5bb4f733f7aaeb1162e880eaa (patch) | |
| tree | 9888cdb1305dd85a237df2271c93b849b241eec9 /src/comp/middle/ty.rs | |
| parent | Further on the path toward self-awareness. (diff) | |
| download | rust-4fc8de196977a0e5bb4f733f7aaeb1162e880eaa.tar.xz rust-4fc8de196977a0e5bb4f733f7aaeb1162e880eaa.zip | |
Last pieces of self-call support.
The last few pieces of the hack that lets us use trans.trans_call() to
translate self-calls, plus a fix for the parser buy that was
preventing self-call expressions from getting past parsing.
test/run-pass/obj-self.rs works now (as in it actually prints "hi!"
twice!).
Diffstat (limited to 'src/comp/middle/ty.rs')
| -rw-r--r-- | src/comp/middle/ty.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index 24bd647f..f83bece7 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -26,6 +26,12 @@ type method = rec(ast.proto proto, type mt = rec(@t ty, ast.mutability mut); +// Convert from method type to function type. Pretty easy; we just drop +// 'ident'. +fn method_ty_to_fn_ty(method m) -> @ty.t { + ret plain_ty(ty_fn(m.proto, m.inputs, m.output)); +} + // NB: If you change this, you'll probably want to change the corresponding // AST structure in front/ast.rs as well. type t = rec(sty struct, option.t[str] cname); |