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

Inexistent locations on error when component returns list of elements #90

Closed jchavarri closed 2 years ago

jchavarri commented 2 years ago
let%component make () = [ React.null ]

Will trigger this error:

Error: This expression has type
         <  > Js_of_ocaml.Js.t -> React__Core.element list
       but an expression was expected of type
         <  > Js_of_ocaml.Js.t React.component =
           <  > Js_of_ocaml.Js.t -> React__Core.element
       Type React__Core.element list is not compatible with type
         React__Core.element

but with no locations.

jchavarri commented 2 years ago

Another example:

let%component make ~onClick = React.Fragment.make ~children:[]
Error: This expression has type
         < onClick : 'res Js_of_ocaml.Js.readonly_prop > Js_of_ocaml.Js.t ->
         ?key:string -> unit -> React__Core.element
       but an expression was expected of type
         < onClick : 'res Js_of_ocaml.Js.readonly_prop > Js_of_ocaml.Js.t
         React.component =
           < onClick : 'res Js_of_ocaml.Js.readonly_prop > Js_of_ocaml.Js.t ->
           React.element
       Type ?key:string -> unit -> React__Core.element
       is not compatible with type React.element = React__Core.element