Skip to content

Commit a2a642c

Browse files
committed
Correct bug in typechecking ctor arguments to nonempty objects.
1 parent ac270fc commit a2a642c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/comp/middle/typeck.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ fn collect_item_types(@ast.crate crate) -> tup(@ast.crate, @ty_table) {
217217
auto t_obj = ty_of_obj(id_to_ty_item, item_to_ty, obj_info);
218218
let vec[arg] t_inputs = vec();
219219
for (ast.obj_field f in obj_info.fields) {
220-
auto t_field = getter(id_to_ty_item, item_to_ty, f.id);
220+
auto g = bind getter(id_to_ty_item, item_to_ty, _);
221+
auto t_field = ast_ty_to_ty(g, f.ty);
221222
append[arg](t_inputs, rec(mode=ast.alias, ty=t_field));
222223
}
223224
auto t_fn = plain_ty(ty.ty_fn(t_inputs, t_obj));

0 commit comments

Comments
 (0)