Stream: bugs

Topic: Json parsing fails for simple nominal type


view this post on Zulip George (Aug 21 2026 at 18:50):

This pretty simple code example fails on the roc main branch:

app [main!] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.22.0/F1JVZPYfWP71s8vk6tHcV1Qx1Ef6CZkwswGoCn8VHZmL.tar.zst" }

import pf.Stdin
import pf.Stdout

main! = |_args| {
    dto : FooDto
    dto = Json.parse(Stdin.line!()?)?

    Stdout.line!("Parsed ${dto.foo}")?

    Ok({})
}

FooDto := {
    foo: Str
}.{
    parser_for : _
}

When I run roc main.roc it looks like this:

thread 6972890 panic: postcheck invariant violated: non-runtime checked expression reached Monotype lowering
roc
  ✓ Resolving Dependencies       4ms
/path/to/roc/src/postcheck/common.zig:122:24: 0x1088c42d7 in invariant__anon_407876 (roc)

... (Note: I removed most of the stack trace )

/path/to/zig/0.16.0/lib/std/Thread.zig:752:30: 0x10946a903 in entryFn (roc)
                return callFn(f, args_ptr.*);
                             ^
???:?:?: 0x182be9c57 in __pthread_cond_wait (/usr/lib/system/libsystem_pthread.dylib)
???:?:?: 0x182be4c1b in _pthread_cond_broadcast (/usr/lib/system/libsystem_pthread.dylib)
fish: Job 1, 'roc' terminated by signal SIGABRT (Abort)

The program runs just fine when I change the definition of dto to dto : { foo: Str }.

view this post on Zulip Richard Feldman (Aug 21 2026 at 19:09):

@George can you open a GitHub issue for this one too? :smiley:

view this post on Zulip George (Aug 21 2026 at 19:14):

created https://github.com/roc-lang/roc/issues/10898


Last updated: Sep 03 2026 at 15:16 UTC