Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

[Help wanted] Improving "Somewhere wanted" error messages

$
0
0

This isn’t a “Somewhere wanted” error message but it is likely confusing to beginners regardless–

type a = { "one": int }
@val external myA: a = "a";
let b = switch myA {
  | { "one": 1 } => "foo"
  | _ => "bar"
}

The above code errors with:

Syntax Errors
[E] Line 4, column 5:
Did you forget a } here?
[E] Line 4, column 12:
consecutive statements on a line must be separated by ‘;’ or a newline

Rather than explaining that pattern-matching does not support object types.


Viewing all articles
Browse latest Browse all 2592

Trending Articles