Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 5 tasks
illusionalsagacity opened this issue Feb 2, 2023 · 4 comments · Fixed by #5971
Closed
2 of 5 tasks

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

illusionalsagacity opened this issue Feb 2, 2023 · 4 comments · Fixed by #5971
Assignees
Milestone

Comments

@illusionalsagacity
Copy link
Contributor

illusionalsagacity commented Feb 2, 2023

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

@mununki mununki self-assigned this Feb 3, 2023
@mununki
Copy link
Member

mununki commented Feb 3, 2023

Here is the simplified example to reproduce:

@@jsxConfig({ version: 4 })

@react.component
let make = (~a: (. unit) => unit=(. ) => ()) => React.null

@mununki
Copy link
Member

mununki commented Feb 3, 2023

[E] Line 4, column 33:
This has type: (. ()) => unit
  Somewhere wanted: unit => unit

@mununki
Copy link
Member

mununki commented Feb 3, 2023

This is fixed in the master.

@mununki
Copy link
Member

mununki commented Feb 3, 2023

rescript-lang/syntax#731 would fix this issue for v10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants