Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PNC + ? suffix interaction #7548

Merged
merged 2 commits into from
Jan 25, 2025
Merged

Fix PNC + ? suffix interaction #7548

merged 2 commits into from
Jan 25, 2025

Conversation

smores56
Copy link
Collaborator

module [something]

something = |_|
    ["hello"] |> List.first()?
> cargo run --bin roc -- check test2.roc
...

── TYPE MISMATCH in ../test2.roc ───────────────────────────────────────────────

This returns something that's incompatible with the return type of the
enclosing function:

4│      ["hello"] |> List.first()?
        ^^^^^^^^^^^^^^^^^^^^^^^^^

This returns an Err of type:

    [Err [ListWasEmpty]]

But I expected the function to have return type:

    Str

────────────────────────────────────────────────────────────────────────────────

1 error and 0 warnings found in 121 ms.

@smores56 smores56 marked this pull request as ready for review January 25, 2025 13:46
@smores56 smores56 merged commit b0a4a64 into roc-lang:main Jan 25, 2025
18 of 19 checks passed
@smores56 smores56 deleted the fix-pnc-try branch January 25, 2025 14:50
Anton-4 added a commit to roc-lang/basic-webserver that referenced this pull request Jan 28, 2025
Anton-4 added a commit to roc-lang/basic-webserver that referenced this pull request Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants