roc icon indicating copy to clipboard operation
roc copied to clipboard

Expr::TrySuffix expression was not completely removed in desugar_value_def_suffixed

Open tonyfinn opened this issue 1 year ago • 1 comments

Error:

An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: <https://github.com/roc-lang/roc/issues/new/choose>
a Expr::TrySuffix expression was not completely removed in desugar_value_def_suffixed
Location: crates/compiler/can/src/expr.rs:1174:40

Code:

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

import pf.Arg
import pf.File
import pf.Stdout

main =
    Arg.list! {}
        |> List.get 0
        |> Result.withDefault "input.txt"
        |> File.readUtf8!
        |> Stdout.line!

(This is literally my first Roc program, so not sure what else would be helpful)

tonyfinn avatar Dec 01 '24 21:12 tonyfinn

Sorry for the bad first experience @tonyfinn!

I've made this a high priority issue.

As a workaround; you can leave out the final !, so |> Stdout.line

Anton-4 avatar Dec 02 '24 11:12 Anton-4