rescript-compiler icon indicating copy to clipboard operation
rescript-compiler copied to clipboard

Uncurrying breaks components with local type variables

Open glennsl opened this issue 1 year ago • 0 comments

Repro, in v11 with uncurrying enabled:

module A = {
  @react.component
  let make = (type a, ~foo=?) => React.null
}

<A />

yields the error:

[E] Line 6, column 1:
This has type: A.props => (~foo: 'a=?) => React.element
  But this function argument is expecting:
    React.component<A.props> (defined as A.props => Jsx.element)
  
  The incompatible parts:
    (~foo: 'a=?) => React.element vs Jsx.element (defined as JsxU.element)

This works both in v10, and v11 with uncurrying disabled.

glennsl avatar Feb 09 '24 15:02 glennsl