Merge remote-tracking branch 'origin/main' into roc-dev-inline-expects

This commit is contained in:
Folkert 2022-10-24 18:39:30 +02:00
commit b4878e5550
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
45 changed files with 630 additions and 331 deletions

View file

@ -6063,6 +6063,20 @@ fn run_low_level<'a, 'ctx, 'env>(
bitcode::STR_WITH_CAPACITY,
)
}
StrGraphemes => {
// Str.graphemes : Str -> List Str
debug_assert_eq!(args.len(), 1);
let string = load_symbol(scope, &args[0]);
call_str_bitcode_fn(
env,
&[string],
&[],
BitcodeReturns::List,
bitcode::STR_GRAPHEMES,
)
}
ListLen => {
// List.len : List * -> Nat
debug_assert_eq!(args.len(), 1);

View file

@ -147,6 +147,8 @@ fn build_eq<'a, 'ctx, 'env>(
rhs_layout: &Layout<'a>,
when_recursive: WhenRecursive<'a>,
) -> BasicValueEnum<'ctx> {
let lhs_layout = &lhs_layout.runtime_representation(env.layout_interner);
let rhs_layout = &rhs_layout.runtime_representation(env.layout_interner);
if lhs_layout != rhs_layout {
panic!(
"Equality of different layouts; did you have a type mismatch?\n{:?} == {:?}",