Skip to content

Commit

Permalink
Add another example to todo-better-errors list
Browse files Browse the repository at this point in the history
  • Loading branch information
shwestrick authored Feb 8, 2023
1 parent 656885b commit fb387c6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions todo-better-errors.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Error messages that could be better

## Expected to see type constructor

**Problem**: The parser sees `(..., ...)` as the beginning of a type, and
thinks that there is a missing type constructor. It's likely however that
the programmer forgot to use product syntax (with `*`) for tuple types.

**Ideal Solution**: Highlight the `(..., ...)` with an appropriate error
message. Something like: "Invalid or incomplete type". Explain the `*`
syntax in below the source reference.

```
Unexpected token.
foo.sml
|
1 | val x: (int, int) = (42, 15210)
| ^
Expected to see a type constructor.
```

## Equal-sign looks like identifier

**Problem**: The parser tries to use '=' as the name of a variable, but gets
Expand Down

0 comments on commit fb387c6

Please sign in to comment.