Fix List.set tests

This commit is contained in:
Richard Feldman 2020-03-08 01:20:43 -05:00
parent 94b41b099f
commit be4abcf173
4 changed files with 22 additions and 29 deletions

View file

@ -593,12 +593,7 @@ fn call_with_args<'a, 'ctx, 'env>(
builder.build_load(elem_ptr, "List.get")
}
Symbol::LIST_SET => {
debug_assert!(args.len() == 3);
panic!("TODO List.set with clone");
}
Symbol::LIST_SET_IN_PLACE => {
Symbol::LIST_SET /* TODO clone first for LIST_SET! */ | Symbol::LIST_SET_IN_PLACE => {
debug_assert!(args.len() == 3);
let list_ptr = args[0].into_pointer_value();

View file

@ -56,7 +56,9 @@ pub fn basic_type_from_layout<'ctx>(
.as_basic_type_enum(),
Map(_, _) => panic!("TODO layout_to_basic_type for Builtin::Map"),
Set(_) => panic!("TODO layout_to_basic_type for Builtin::Set"),
List(_) => panic!("TODO layout_to_basic_type for Builtin::List"),
List(elem_layout) => basic_type_from_layout(context, elem_layout)
.ptr_type(AddressSpace::Generic)
.as_basic_type_enum(),
},
}
}