-
-
Notifications
You must be signed in to change notification settings - Fork 888
Open
Labels
good first issueGood for newcomersGood for newcomershelp wantedContributions encouragedContributions encouraged
Description
Someone coming from TypeScript can write following code:
import gleam/io
pub fn main(): Nil {
io.println("Hello from test_gleam!")
}In this case compiler gives this unhelpful message:
error: Syntax error
┌─ C:\Users\user\projects\test_gleam\src\test_gleam.gleam:3:14
│
3 │ pub fn main(): Nil {
│ ^ I was not expecting this
Found `:`, expected one of:
- An import, const, type, or function.
I think that it would be better if error message will be something like:
error: Syntax error
┌─ C:\Users\user\projects\test_gleam\src\test_gleam.gleam:3:14
│
3 │ pub fn main(): Nil {
│ ^ I was not expecting this
Found `:`, expected one of:
- An import, const, type, or function.
Hint: Maybe you meant to write return value type annotation?
Return type annotations are written using `->`, not `:`
If this is wanted feature, I can try to work on this.
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedContributions encouragedContributions encouraged