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

Compiler prevents adding attributes in front of {

Open benadamstyles opened this issue 3 months ago • 1 comments

The compiler (v11) does not support @s.strict in the following structure:

@schema
type t = @s.strict {
  email: string,
  name: string,
}

This is expected to work at least by some library developers, see original bug report: https://github.com/DZakh/sury/issues/151

benadamstyles avatar Aug 28 '25 15:08 benadamstyles

This is exactly what discussed missing in the PR to support adding an attribute without "|" in a variant type declaration. A follow-on PR would address this. Well at least the parse error. CC @zth

cristianoc avatar Aug 28 '25 21:08 cristianoc