Stream: beginners

Topic: Open tag union formatting


view this post on Zulip Bryce Miller (Jul 05 2026 at 19:01):

I noticed while migrating roc-pg that the formatter drops any named tag union extension: [Foo, Bar, ..others] -> [Foo, Bar, ..]. Here's the type in question:

    Decode(a, err) :: List(RowField) -> Try(
        List(List(U8)) -> Try(a, [FieldNotFound(Str), ..err]),
        [FieldNotFound(Str)],
    )

I thought this was a bug in the formatter but I see a comment in the source indicating that this is intentional (fmt.zig:2851). The language reference indicates that the ..others syntax is valid, so I'm a little confused.

Should the type above simply be Decode(a) :: ...?

view this post on Zulip JRI98 (Jul 05 2026 at 21:05):

I think it is an actual bug and I opened https://github.com/roc-lang/roc/issues/9939 recently.

view this post on Zulip Richard Feldman (Jul 05 2026 at 21:34):

yeah it's a bug!


Last updated: Jul 23 2026 at 13:15 UTC