aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-12-16 10:34:54 -0800
committerGraydon Hoare <[email protected]>2010-12-16 10:34:54 -0800
commit9759d1e08ad288f84a262257242bfd167d2492e8 (patch)
tree60148bb44f772de06b616695fd97a53cde8f18a1 /src
parentCollect obj items, translate obj-name references and obj-ctor types. (diff)
downloadrust-9759d1e08ad288f84a262257242bfd167d2492e8.tar.xz
rust-9759d1e08ad288f84a262257242bfd167d2492e8.zip
Annotate obj items while folding ast in typeck.
Diffstat (limited to 'src')
-rw-r--r--src/comp/middle/typeck.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs
index bd12cf6f..9837ffa1 100644
--- a/src/comp/middle/typeck.rs
+++ b/src/comp/middle/typeck.rs
@@ -597,6 +597,16 @@ fn collect_item_types(@ast.crate crate) -> tup(@ast.crate, @ty_table) {
ret @fold.respan[ast.item_](sp, item);
}
+ fn fold_item_obj(&@env e, &span sp, ast.ident i,
+ &ast._obj ob, vec[ast.ty_param] ty_params,
+ ast.def_id id, ast.ann a) -> @ast.item {
+ check (e.item_to_ty.contains_key(id));
+ auto ty = e.item_to_ty.get(id);
+ auto item = ast.item_obj(i, ob, ty_params, id,
+ ast.ann_type(ty));
+ ret @fold.respan[ast.item_](sp, item);
+ }
+
fn fold_item_ty(&@env e, &span sp, ast.ident i,
@ast.ty t, vec[ast.ty_param] ty_params,
ast.def_id id, ast.ann a) -> @ast.item {
@@ -623,6 +633,7 @@ fn collect_item_types(@ast.crate crate) -> tup(@ast.crate, @ty_table) {
@rec(update_env_for_item = bind convert(_,_),
fold_item_const = bind fold_item_const(_,_,_,_,_,_,_),
fold_item_fn = bind fold_item_fn(_,_,_,_,_,_,_),
+ fold_item_obj = bind fold_item_obj(_,_,_,_,_,_,_),
fold_item_ty = bind fold_item_ty(_,_,_,_,_,_,_),
fold_item_tag = bind fold_item_tag(_,_,_,_,_,_)
with *fld_2);