Stream: bugs

Topic: Inverted record fields


view this post on Zulip Guillaume Sarisson (Jun 10 2026 at 18:23):

Hi there,

I tried to make a complex number type of the form :

Complex : { real : F64, imaginary : F64 }

But for some reasons the following code gives me a wrong result, it looks like the fields are inverted :

z : Complex
z = { real: 1, imaginary: 2 }

main! = |_args| {
    Stdout.line!("real = ${z.real.to_str()}")
    Stdout.line!("imaginary = ${z.imaginary.to_str()}")
    Ok({})
}
real = 2
imaginary = 1

Did I miss something about how to use records ? Is it a known issue ?

view this post on Zulip Luke Boswell (Jun 10 2026 at 20:52):

Could you please make a GH Issue, this looks like a new bug we arent tracking.

view this post on Zulip Richard Feldman (Jun 10 2026 at 21:05):

and definitely please include a full .roc file so we can reproduce! :smiley:

view this post on Zulip Guillaume Sarisson (Jun 10 2026 at 21:23):

Will do ! :slight_smile:


Last updated: Jun 16 2026 at 16:19 UTC