gleam-lang / gleam

⭐️ A friendly language for building type-safe, scalable systems!
https://gleam.run
Apache License 2.0
16.7k stars 698 forks source link

Remove "expected if block" from parse error #2985

Closed giacomocavalieri closed 3 months ago

giacomocavalieri commented 3 months ago
pub fn thing() {
  "a"
}

const wibble = thing()

This snippet of code results in this error message:

error: Syntax error
  ┌─ /src/main.gleam:7:21
  │
7 │ const wibble = thing()
  │                     ^ I was not expecting this

Expected one of: 
An import, const, type, if block, or function.

The error says it's expecting an if block but as far as I'm aware Gleam no longer has those, we could remove it.

giacomocavalieri commented 3 months ago

Oops I just noticed this is no longer Gleam's behaviour on main