A reasonable failure when working with nominal records, but a type error would be nicer :).
Minimal example:
# Wrap.roc
expect Wrap.{ a: 1, b: 0 }.inc_a() == Wrap.{ a: 2, b: 0 }
Wrap :: { a : U8, b : U8 }.{
inc_a : Wrap -> Wrap
inc_a = |wrap| Wrap.{ ..wrap, a: wrap.a + 1 }
}
Running roc test Wrap.roc yields:
thread 962727 panic: postcheck invariant violated: instantiation record field access encountered a recursive named backing
Easily fixed by either of these implementations of inc_a, so definitely not blocking me:
inc_a = |Wrap.(wrap)| Wrap.{ ..wrap, a: wrap.a + 1 }
inc_a = |wrap| { ..wrap, a: wrap.a + 1 }
A reasonable failure when working with nominal records, but a type error would be nicer :).
Minimal example:
Running
roc test Wrap.rocyields:Easily fixed by either of these implementations of
inc_a, so definitely not blocking me: