Semantic Diff

#9160 Fix %todo with a local JsError module, and the location in its message

2 commits

f88294f29a50c4ec4292adea6aefc711e1b199f9..pr-9160

1d4c02814 · cknitt + Claude · Nov 01, 2026, 08:12 UTC

Expand %todo to the standard library's JsError, located like __LOC__

Why

%todo called JsError.throwWithMessage by name, so a user module named JsError replaced it. Its message also embedded the absolute path of the source file, and character offsets from the start of the file as columns.

modifiedJS %todo with a local JsError module

module JsError = {  let throwWithMessage = (s: string) => s}let f = (_: int): int => %todo("later")
diagnostic
Before
This has type: stringBut it's expected to have type: int
js
After
function f(param) {  return Stdlib_JsError.throwWithMessage("A.res:4:25-30 - Todo: later");}

modifiedJS %todo message

let a = 1let f = () => %todo
js
Before
After
return Stdlib_JsError.throwWithMessage("/home/me/app/src/D.res:2:24-29 - Todo");return Stdlib_JsError.throwWithMessage("D.res:2:14-19 - Todo");
0c2890fb3 · cknitt + Claude · Nov 01, 2026, 16:10 UTC

Allow the %todo warning in the tests project instead of in the test

Every %todo reports warning 110, which the tests project turned into an error. Answers the Codex review on #9160: rather than disabling the warning in todo_shadowing_test.res, the project keeps 110 a warning (-warn-error A-110), and every other warning stays an error.