Skip to content

10.1.2 JSXv4 Regression uncurried prop type is parsed as curried #5969

Closed
@illusionalsagacity

Description

@illusionalsagacity

First of all, amazing work on the 10.1 release. Lots of great stuff.

Thank you for filing! Check list:

  • Is it a bug? Usage questions should often be asked in the forum instead.
  • Concise, focused, friendly issue title & description.
  • A minimal, reproducible example.
  • OS and browser versions, if relevant.
  • Is it already fixed in master?

the following compiles:

@@jsxConfig({ version: 3 })

let func = (~callback: (. string, bool, bool) => unit=(. _, _, _) => (), ()) => ();

func(~callback=(. str, a, b) => (), ())

module Foo = {
  @react.component
  let make = (
    ~callback: (. string, bool, bool) => unit=(. _, _, _) => (),
  ) => {
    React.null
  }
}

module Bar = {
  @react.component
  let make = () => <Foo callback={(. _, _, _) => ()} />
}

But changing to @@jsxConfig({ version: 4 }) gives the following error:

[E] Line 10, column 46:
This has type: (. 'a, 'b, 'c) => unit
  Somewhere wanted: (string, bool, bool) => unit

example

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions