syntax icon indicating copy to clipboard operation
syntax copied to clipboard

Mistyping @react.component yields confusing error message

Open glennsl opened this issue 3 years ago • 0 comments

module Button = {
  @react.componentt
  let make = (~count: int) => {
    <button> {count->React.int} </button>
  }
}

let make = () => <Button count=3 />

yields this error at the call site

This has type: (~count: int) => React.element
  Somewhere wanted: React.component<'a> (defined as 'a => React.element)

I would have expected a warning about an unused annotation or something similar.

glennsl avatar May 08 '22 20:05 glennsl