Semantic Diff

#9363 Return the parser's warnings instead of printing them

1 commit

0ecb8d70790159f4bf80c9bb457652d1bb707983..pr-9363

0aef0e215 · cknitt + Claude · Nov 20, 2026, 22:07 UTC

Return the parser's warnings instead of printing them

The parser printed its one warning, for the deprecated (. ...) syntax, through the compiler's warning reporting when it finished. It now keeps its warnings as values of a new type, Res_warning.t, and returns them with the parse result. The compiler reports them as before, right after parsing: Syntax_driver.report_warnings turns them into Warnings.Deprecated, called by bsc, res_parser, the playground and Res_multi_printer. Editor analysis, rescript-tools and the snippets the compiler parses for error hints no longer print the warning. A unit test checks the returned warnings.