about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2010-12-15 10:00:28 -0800
committerPatrick Walton <pcwalton@mimiga.net>2010-12-15 10:00:28 -0800
commit2a8350e8d99c411a7126e0d3412ef36c30e2edc7 (patch)
tree12e3785dd8160023a70ad3d1f95c744a88373111
parent0d3400fec27187592791167d391e0ad6a0bfe7ce (diff)
rustc: Resolve tag names in the typechecker
-rw-r--r--src/comp/middle/typeck.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs
index b3b066a4314..cb599eb74f4 100644
--- a/src/comp/middle/typeck.rs
+++ b/src/comp/middle/typeck.rs
@@ -435,7 +435,9 @@ fn collect_item_types(@ast.crate crate) -> tup(@ast.crate, @ty_table) {
             }
 
             case (ast.item_tag(_, _, _, ?def_id)) {
-                item_to_ty.insert(def_id, plain_ty(ty_tag(def_id)));
+                auto ty = plain_ty(ty_tag(def_id));
+                item_to_ty.insert(def_id, ty);
+                ret ty;
             }
 
             case (ast.item_mod(_, _, _)) { fail; }
@@ -485,6 +487,9 @@ fn collect_item_types(@ast.crate crate) -> tup(@ast.crate, @ty_table) {
             case (ast.item_ty(_, _, _, ?def_id, _)) {
                 id_to_ty_item.insert(def_id, i);
             }
+            case (ast.item_tag(_, _, _, ?def_id)) {
+                id_to_ty_item.insert(def_id, i);
+            }
             case (_) { /* empty */ }
         }
         ret id_to_ty_item;