Skip to content

Commit 7e2f205

Browse files
committed
Add missed case to typeck.ast_ty_to_ty, plus faux exhaustiveness check.
1 parent 416d9bc commit 7e2f205

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/comp/middle/typeck.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,13 @@ fn ast_ty_to_ty(ty_getter getter, &@ast.ty ast_ty) -> @ty {
225225
case (ast.ty_str) { sty = ty_str; }
226226
case (ast.ty_box(?t)) { sty = ty_box(ast_ty_to_ty(getter, t)); }
227227
case (ast.ty_vec(?t)) { sty = ty_vec(ast_ty_to_ty(getter, t)); }
228+
case (ast.ty_tup(?fields)) {
229+
let vec[tup(bool,@ty)] flds = vec();
230+
for (tup(bool, @ast.ty) field in fields) {
231+
flds += tup(field._0, ast_ty_to_ty(getter, field._1));
232+
}
233+
sty = ty_tup(flds);
234+
}
228235

229236
case (ast.ty_fn(?inputs, ?output)) {
230237
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 {
244251
sty = getter(def_id).struct;
245252
cname = some(path_to_str(path));
246253
}
254+
255+
case (_) {
256+
fail;
257+
}
247258
}
248259

249260
ret @rec(struct=sty, cname=cname);

0 commit comments

Comments
 (0)