aboutsummaryrefslogtreecommitdiff
path: root/src/comp
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-11-25 17:06:36 -0800
committerGraydon Hoare <[email protected]>2010-11-25 17:06:36 -0800
commit7e2f2058660ecf0819eee09319d314b3343a03fc (patch)
tree481ba2e42c3463d52b2aa8ca020d478e58ad4339 /src/comp
parentFix typo in numeric-label-parsing loop. (diff)
downloadrust-7e2f2058660ecf0819eee09319d314b3343a03fc.tar.xz
rust-7e2f2058660ecf0819eee09319d314b3343a03fc.zip
Add missed case to typeck.ast_ty_to_ty, plus faux exhaustiveness check.
Diffstat (limited to 'src/comp')
-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 0fd55d5d..b6c47c5e 100644
--- a/src/comp/middle/typeck.rs
+++ b/src/comp/middle/typeck.rs
@@ -225,6 +225,13 @@ fn ast_ty_to_ty(ty_getter getter, &@ast.ty ast_ty) -> @ty {
case (ast.ty_str) { sty = ty_str; }
case (ast.ty_box(?t)) { sty = ty_box(ast_ty_to_ty(getter, t)); }
case (ast.ty_vec(?t)) { sty = ty_vec(ast_ty_to_ty(getter, t)); }
+ case (ast.ty_tup(?fields)) {
+ let vec[tup(bool,@ty)] flds = vec();
+ for (tup(bool, @ast.ty) field in fields) {
+ flds += tup(field._0, ast_ty_to_ty(getter, field._1));
+ }
+ sty = ty_tup(flds);
+ }
case (ast.ty_fn(?inputs, ?output)) {
auto f = bind ast_arg_to_arg(getter, _);
@@ -244,6 +251,10 @@ fn ast_ty_to_ty(ty_getter getter, &@ast.ty ast_ty) -> @ty {
sty = getter(def_id).struct;
cname = some(path_to_str(path));
}
+
+ case (_) {
+ fail;
+ }
}
ret @rec(struct=sty, cname=cname);