Stream: beginners

Topic: error in alias analysis


view this post on Zulip Axel (Dec 03 2023 at 17:19):

I'm trying to write a parser for AOC and something funky is happening when I try to run the test:
thread 'main' panicked at 'Error in alias analysis: error in module ModName("UserApp")

I distilled it down to this https://gist.github.com/axelerator/31e572261ef350eeb8205573a2507bc1

view this post on Zulip Brendan Hansknecht (Dec 03 2023 at 17:20):

Does roc check help with the error at all?

view this post on Zulip Notification Bot (Dec 03 2023 at 17:20):

2 messages were moved here from #beginners > dbg not showing on roc test by Brendan Hansknecht.

view this post on Zulip Axel (Dec 03 2023 at 17:21):

roc check just complains about my unused imports :thinking:

view this post on Zulip Brendan Hansknecht (Dec 03 2023 at 17:25):

I am not sure, but maybe @Luke Boswell or someone else that uses that parse library might have some ideas. Probably also worth filing an issue with that sample code.

view this post on Zulip Luke Boswell (Dec 03 2023 at 18:11):

I suspect the issue is List.join as thats not a combinator from the parser library. Im on my mobile so I cant check easily rn.

view this post on Zulip LoipesMas (Dec 03 2023 at 19:26):

It is really weird. I wanted to try and see if I can at least pinpoint it better, but I failed I have a guess. If you change the list to oneOf in parseRow (either remove an element or change an element) the error disappears. If you add an expect that uses parseNumber or parseRow, the error disappears as well. If, instead, you change the expect to use parseRow instead of parseDot, the error also disappears. My guess would be that some part of the compiler thinks that parseNumber can be removed (rightly so), but another part tries to access it anyway. But I don't know the internals of the compiler, so that's just a guess. Hopefully that helps someone!

view this post on Zulip Luke Boswell (Dec 03 2023 at 19:55):

That error suggests to me it's lambda sets or something deep within the compiler and those are usually not easy bugs to find. If we could isolate this could be another good test case, but my concern is that there is a lot of layers here with the parser library. It's not something I probably have time too look at myself today. Basically we need to start with something broken, then keep deleting stuff until we have a minimal repro.

view this post on Zulip Luke Boswell (Dec 03 2023 at 19:56):

That doesn't really help @Axel get working code though unfortunately.

view this post on Zulip Luke Boswell (Dec 03 2023 at 19:58):

Also const [Dot] doesn't look right to me. Maybe it should be const Dot |> instead?


Last updated: Jul 05 2025 at 12:14 UTC