From 7e2f2058660ecf0819eee09319d314b3343a03fc Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Thu, 25 Nov 2010 17:06:36 -0800 Subject: Add missed case to typeck.ast_ty_to_ty, plus faux exhaustiveness check. --- src/comp/middle/typeck.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/comp/middle') 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); -- cgit v1.2.3