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

MultipleCharsInSingleQuote runtime error not reported during compilation #7260

Open
JRI98 opened this issue Nov 28, 2024 · 1 comment
Open
Labels
bug Something isn't working error-messages Related to the quality of error messages

Comments

@JRI98
Copy link
Contributor

JRI98 commented Nov 28, 2024

The following program builds without errors or warnings, but crashes at runtime with MultipleCharsInSingleQuote(@158-163):

app [main] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.16.0/O00IPk-Krg_diNS2dVWlI0ZQP794Vctxzv0ha96mK0E.tar.br" }

main = Task.ok '123'
@Anton-4 Anton-4 added the bug Something isn't working label Nov 28, 2024
@lukewilliamboswell lukewilliamboswell added the error-messages Related to the quality of error messages label Nov 28, 2024
@lukewilliamboswell
Copy link
Collaborator

The error message is provided by the platform. When roc hits a runtime error it call into roc_panic with a message. That message is generated from crates/compiler/problem/src/can.rs and currently uses the derived Debug impl.

pub fn runtime_message(self) -> String {
    use RuntimeError::*;

    match self {
        DegenerateBranch(region) => {
            format!(
                "Hit a branch pattern that does not bind all symbols its body needs, at {region:?}"
            )
        }
        err => format!("{err:?}"),
    }
}

We should probably provide a nicer error message string for roc_panic to print for end users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working error-messages Related to the quality of error messages
Projects
None yet
Development

No branches or pull requests

3 participants