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

Invalid .resi generated

Open cknitt opened this issue 7 months ago • 1 comments

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 avatar May 08 '25 13:05 cknitt

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

cknitt avatar May 08 '25 14:05 cknitt