syntax
syntax copied to clipboard
Consider having a more helpful error-message for `option<'a>`
I see this trip up a lot of newcomers, especially with the generic 'a.
This pattern matches values of type option<'a>
but a pattern was expected which matches values of type foo
Is it possible to show `option
Here's one example:
type foo = {bar: unit => unit}
external foo: unit => foo = "foo"
let x = foo()
switch x {
| Some(foo) => foo.bar()
| None => ()
}
Originally posted by @lessp in https://github.com/rescript-lang/syntax/issues/336#issuecomment-809559645