mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-23 08:48:03 +00:00
Fix CI failure
This commit is contained in:
parent
15c3dda28b
commit
fd22eff4ee
2 changed files with 26 additions and 24 deletions
|
|
@ -331,15 +331,15 @@ Builtin :: [].{
|
|||
from_numeral : Numeral -> Try(U8, [InvalidNumeral(Str), ..others])
|
||||
from_str : Str -> Try(U8, [BadNumStr, ..others])
|
||||
|
||||
## List of integers beginning with this `U8` and ending with the other `U8`.
|
||||
## (Use [until] instead to end with the other `U8` minus one.)
|
||||
## Returns an empty list if this `U8` is greater than the other.
|
||||
# # List of integers beginning with this `U8` and ending with the other `U8`.
|
||||
# # (Use [until] instead to end with the other `U8` minus one.)
|
||||
# # Returns an empty list if this `U8` is greater than the other.
|
||||
to : U8, U8 -> List(U8)
|
||||
to = |start, end| range_to(start, end)
|
||||
|
||||
## List of integers beginning with this `U8` and ending with the other `U8` minus one.
|
||||
## (Use [to] instead to end with the other `U8` exactly, instead of minus one.)
|
||||
## Returns an empty list if this `U8` is greater than or equal to the other.
|
||||
# # List of integers beginning with this `U8` and ending with the other `U8` minus one.
|
||||
# # (Use [to] instead to end with the other `U8` exactly, instead of minus one.)
|
||||
# # Returns an empty list if this `U8` is greater than or equal to the other.
|
||||
until : U8, U8 -> List(U8)
|
||||
until = |start, end| range_until(start, end)
|
||||
|
||||
|
|
@ -990,25 +990,25 @@ Builtin :: [].{
|
|||
}
|
||||
|
||||
range_to = |var $current, end| {
|
||||
var $answer = [] # Not bothering with List.with_capacity because this will become an iterator once those exist.
|
||||
var $answer = [] # Not bothering with List.with_capacity because this will become an iterator once those exist.
|
||||
|
||||
while $current <= end {
|
||||
$answer = $answer.append($current)
|
||||
$current = $current + 1
|
||||
}
|
||||
while $current <= end {
|
||||
$answer = $answer.append($current)
|
||||
$current = $current + 1
|
||||
}
|
||||
|
||||
$answer
|
||||
$answer
|
||||
}
|
||||
|
||||
range_until = |var $current, end| {
|
||||
var $answer = [] # Not bothering with List.with_capacity because this will become an iterator once those exist.
|
||||
var $answer = [] # Not bothering with List.with_capacity because this will become an iterator once those exist.
|
||||
|
||||
while $current < end {
|
||||
$answer = $answer.append($current)
|
||||
$current = $current + 1
|
||||
}
|
||||
while $current < end {
|
||||
$answer = $answer.append($current)
|
||||
$current = $current + 1
|
||||
}
|
||||
|
||||
$answer
|
||||
$answer
|
||||
}
|
||||
|
||||
# Implemented by the compiler, does not perform bounds checks
|
||||
|
|
|
|||
|
|
@ -1481,13 +1481,15 @@ pub const Interpreter = struct {
|
|||
// Get the result layout - should be List(U8).
|
||||
// If return_rt_var is a flex that would default to a scalar,
|
||||
// we need to ensure we get a proper list layout for correct refcounting.
|
||||
const result_rt_var = return_rt_var orelse {
|
||||
self.triggerCrash("str_to_utf8 requires return type info", false, roc_ops);
|
||||
return error.Crash;
|
||||
};
|
||||
const result_layout = blk: {
|
||||
if (return_rt_var) |rt_var| {
|
||||
const maybe_layout = try self.getRuntimeLayout(rt_var);
|
||||
// If the layout is a list, use it
|
||||
if (maybe_layout.tag == .list or maybe_layout.tag == .list_of_zst) {
|
||||
break :blk maybe_layout;
|
||||
}
|
||||
const maybe_layout = try self.getRuntimeLayout(result_rt_var);
|
||||
// If the layout is a list, use it
|
||||
if (maybe_layout.tag == .list or maybe_layout.tag == .list_of_zst) {
|
||||
break :blk maybe_layout;
|
||||
}
|
||||
// Fallback: create a proper List(U8) layout
|
||||
const u8_layout_idx = try self.runtime_layout_store.insertLayout(Layout.int(.u8));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue