Stream: beginners

Topic: Tag possibilities error message


view this post on Zulip Ghislain (Oct 12 2022 at 15:01):

During presentation of Taste of Roc, we had a nice Tag errors messages.

This when does not cover all the possibilities:

    when ...

Other possibilities include:

    Err (FileReadErr _)

But trying the file.roc, I can't find how to reproduce it, it looks like we lost this.

The argument is an anonymous function of type:

    [Err [FileWriteErr a [PermissionDenied, ...], Ok {}] -> Task ExitCode [] [Read [Env, File]c,
    Write [File, Stderr, Stdout]d]e ?

But attempt needs its 2nd argument to be:

    Result {} [FileReadErr Path.Path File.ReadErr ...], ->
    Task ExitCode [] [Read [Env, File]c, Write [File, Stderr,
    Stdout]d]e ?

Is it something known? Or am I expecting something wrong?

view this post on Zulip Ayaz Hafiz (Oct 12 2022 at 15:10):

Yeah, this is known... we should be doing a lot better here :sweat_smile:

view this post on Zulip Ayaz Hafiz (Oct 12 2022 at 15:11):

We have some ideas to improve this but they haven't been done yet

view this post on Zulip Ayaz Hafiz (Oct 12 2022 at 15:11):

Could you file a bug report with this reproduction? It would be a good test case for improving the error message here!

view this post on Zulip Ghislain (Oct 12 2022 at 15:13):

I'm not good at naming issues, do you have a suggestion?

view this post on Zulip Ayaz Hafiz (Oct 12 2022 at 15:14):

One sec, I'm gonna make a mega-issue to collect these reproductions

view this post on Zulip Ghislain (Oct 12 2022 at 15:14):

much better if it's you! :sweat_smile:

view this post on Zulip Ayaz Hafiz (Oct 12 2022 at 15:21):

:landing: could you add the reproduction to https://github.com/roc-lang/roc/issues/4314?

view this post on Zulip Ghislain (Oct 12 2022 at 15:23):

the zulip link seems broken in the issue

view this post on Zulip Ayaz Hafiz (Oct 12 2022 at 15:36):

Oops, it's a private channel. Folks are added to it after they land a couple PRs to the compiler


Last updated: Jul 06 2025 at 12:14 UTC