diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2012-01-30 11:52:34 +0100 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2012-02-06 09:56:41 +0100 |
| commit | e0fa5cd2edbbb611ff3759a31357a70ca9582245 (patch) | |
| tree | 8c7e0bce2a1ea13e77de4aee89e4b975eb427eb9 /src/comp/syntax | |
| parent | 5c42e3df9c811be18a220f33fbcb229702922104 (diff) | |
| download | rust-e0fa5cd2edbbb611ff3759a31357a70ca9582245.tar.gz rust-e0fa5cd2edbbb611ff3759a31357a70ca9582245.zip | |
Self types for ifaces
This allows a 'Name:' to appear in front of an iface declaration's
name, which will cause 'Name' to refer to the self type (with the same
number of type parameters as the iface has) in the method signatures
of the iface. For example:
iface F: functor<A> {
fn fmap<B>(f: fn(A) -> B) -> F<B>;
}
Issue #1718
Diffstat (limited to 'src/comp/syntax')
| -rw-r--r-- | src/comp/syntax/fold.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/comp/syntax/fold.rs b/src/comp/syntax/fold.rs index 24c0a7446d4..6402571eda5 100644 --- a/src/comp/syntax/fold.rs +++ b/src/comp/syntax/fold.rs @@ -259,9 +259,7 @@ fn noop_fold_item_underscore(i: item_, fld: ast_fold) -> item_ { item_impl(tps, option::map(ifce, fld.fold_ty), fld.fold_ty(ty), vec::map(methods, fld.fold_method)) } - item_iface(tps, methods) { - item_iface(tps, methods) - } + item_iface(tps, methods) { item_iface(tps, methods) } item_res(decl, typms, body, did, cid) { item_res(fold_fn_decl(decl, fld), typms, fld.fold_block(body), did, cid) |
