ml-in-barcelona / jsoo-react

js_of_ocaml bindings for ReactJS. Based on ReasonReact.
https://ml-in-barcelona.github.io/jsoo-react
MIT License
138 stars 19 forks source link

Wrong component type signature when using type annotation #85

Closed jchavarri closed 2 years ago

jchavarri commented 2 years ago
[@@@react.dom]

let%component foo ~(bar : int option) =
  div ~children:[React.string (string_of_int (Option.value ~default:0 bar))] ()

The inferred type is bar:int -> ?key:string -> unit -> React.element, but it should be bar:int option -> ?key:string -> unit -> React.element. Removing the type annotation fixes it.