mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
feat: check errorcode in returned record for a value greater than 0
This commit is contained in:
parent
58f3559c98
commit
8a21b42c20
2 changed files with 90 additions and 3 deletions
|
@ -5274,9 +5274,9 @@ fn run_low_level<'a, 'ctx, 'env>(
|
|||
|
||||
let (string, _string_layout) = load_symbol_and_layout(scope, &args[0]);
|
||||
|
||||
if let Layout::Union(UnionLayout::NonRecursive(union_layout)) = layout {
|
||||
if let Layout::Struct(struct_layout) = layout {
|
||||
// match on the return layout to figure out which zig builtin we need
|
||||
let intrinsic = match union_layout[1][0] {
|
||||
let intrinsic = match struct_layout[0] {
|
||||
Layout::Builtin(Builtin::Int(int_width)) => &bitcode::STR_TO_INT[int_width],
|
||||
Layout::Builtin(Builtin::Float(float_width)) => {
|
||||
&bitcode::STR_TO_FLOAT[float_width]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue