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 ?
Could you please make a GH Issue, this looks like a new bug we arent tracking.
and definitely please include a full .roc file so we can reproduce! :smiley:
Will do ! :slight_smile:
Last updated: Jun 16 2026 at 16:19 UTC