Stream: beginners

Topic: `roc check` stack overflow


view this post on Zulip Bryce Miller (May 07 2023 at 21:08):

passing the following file to roc check causes a stack overflow:

app "md-parse-test"
    packages {
        cli: "https://github.com/roc-lang/basic-cli/releases/download/0.3.2/tE4xS_zLdmmxmHwHih9kHWQ7fsXtJr7W7h3425-eZFk.tar.br",
    }
    imports [
        cli.Stdout,
    ]

    provides [main] to cli

Section : [
    Section Str (List Block),
]

Block : [
    OrderedList (List ListItem),
    Quote (List Block),
]

ListItem : [
    Children (List Block),
]

main =
    Stdout.line "test"

It seems removing the Quote (List Block) Tag from the Block tag union makes the compiler happy again.

Additionally, changing

ListItem : [
    Children (List Block),
]

to

ListItem : [
    Children (List {}),
]

Also seems to sidestep the crash.

I'm suspecting there should be a type error somewhere here but I'm not sure?

view this post on Zulip Brendan Hansknecht (May 08 2023 at 03:36):

I believe the issue is based on a bug we have with recursive tags. I think also embedding ListItem directly into Block should hopefully fix the error. Hopefully a full work around.

view this post on Zulip Brendan Hansknecht (May 08 2023 at 03:36):

Can you file and issue on GitHub with this example. Having small contained examples is great

view this post on Zulip Bryce Miller (May 08 2023 at 16:00):

Sure can. Thanks for the suggestion, I’ll give that a try when I have a chance.

view this post on Zulip Bryce Miller (May 10 2023 at 10:38):

Filed #5392


Last updated: Jul 06 2025 at 12:14 UTC