Semantic Diff

#8918 Keep multiline inline records in exception and constructor declarations

1 commit, rendered from its record.

Summary

RangeCommitsChangelogAreasJS output changesFormatsFailed checks
58da277de4eeba0d27f17c8056fd4c192e7b7ad9..pr-89181๐Ÿ› Bug fixsyntaxprintertests0none0

Changelog draft

๐Ÿ› Bug fix
  • Keep inline records in exception and constructor declarations multiline when the source has a line break after {.

58da277de4eeba0d27f17c8056fd4c192e7b7ad9..pr-8918

c6e017756 ยท Christoph Knittel ยท Oct 19, 2026

Keep multiline inline records in exception and constructor declarations

๐Ÿ› Bug fixsyntaxprintertests

The formatter keeps an inline record of an exception, a variant constructor or an extension constructor multiline when its first field starts on a later line than the constructor name, as it already does for record type declarations. Before, such inline records were joined onto one line whenever they fit.

Example ReScript

exception Foo({  name: string,  msg: string,})
Before ReScript
exception Foo({name: string, msg: string})
After ReScript
exception Foo({  name: string,  msg: string,})
๐Ÿ› Bug fixKeep inline records in exception and constructor declarations multiline when the source has a line break after {.

Review

No effect
Output: unchangedFormats: nonePPX: unchangedEditor: unchanged
Formatting
changedinline records in exception and constructor declarations written with a line break after { stay multiline
Tests
syntax tests/syntax_tests/data/+ printer/typeDef/inlineRecordMultiline.res~ printer/typeDef/expected/variant.res.txt
5 files ยท +131 โˆ’14 ยท changelog 1 ยท syntax 1 ยท tests 3
Achanges/inline-record-multiline.fix.md+1โˆ’0
Mcompiler/syntax/src/res_printer.ml+25โˆ’13
Atests/syntax_tests/data/printer/typeDef/expected/inlineRecordMultiline.res.txt+53โˆ’0
Mtests/syntax_tests/data/printer/typeDef/expected/variant.res.txt+4โˆ’1
Atests/syntax_tests/data/printer/typeDef/inlineRecordMultiline.res+48โˆ’0
with Claude Opus 5.5