roc-lang / roc

A fast, friendly, functional language.
https://roc-lang.org
Universal Permissive License v1.0
4.46k stars 313 forks source link

Improve error report of `!` suffixed expression mid-pipeline #6934

Open lukewilliamboswell opened 3 months ago

lukewilliamboswell commented 3 months ago

Had this error message while working on some platform things for basic-cli. Logging here as we need to investigate, make a minimal repro, and fix our reporting provide a better error message. It is caused by the ! in the middle of the pipeline here.

── UNRECOGNIZED NAME in examples/../platform/Stdin.roc ─────────────────────────

Nothing is named `#!1_expr` in this scope.

68│>      PlatformTask.stdinBytes
69│>          |> Task.result!
70│>          |> Result.withDefault []
71│>          |> Task.ok