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
This has type: stringBut it's expected to have type: int
js
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");