Skip to content

Invalid .resi generated #7443

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

Open
cknitt opened this issue May 8, 2025 · 1 comment
Open

Invalid .resi generated #7443

cknitt opened this issue May 8, 2025 · 1 comment
Labels
Milestone

Comments

@cknitt
Copy link
Member

cknitt commented May 8, 2025

This was observed in v11:

If I have a component Test.res with the following code:

@react.component
let make = (~size=#large) => {
  let className = switch size {
  | #large => "text-lg"
  | #small => "text-sm"
  }

  <div className />
}

and I generate a .resi from it in VS Code, I get

@react.component
let make: (~size: [< #large | #small large]=?) => Jsx.element

which is invalid.

@cknitt cknitt added the bug label May 8, 2025
@cknitt cknitt added this to the v12 milestone May 8, 2025
@cknitt
Copy link
Member Author

cknitt commented May 8, 2025

Confirmed to be an issue with v12, too, using

./node_modules/rescript/darwinarm64/rescript-editor-analysis.exe createInterface src/Test.res lib/bs/src/Test.cmi

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

No branches or pull requests

1 participant