Semantic Diff

#8948 Annotate the stdlib's runtime classes

1 commit, drawn from its message.

dbe05fbc5dae598251bac6ab952938492a68b103..pr-8948

42175d89a · Christoph Knittel · Oct 21, 2026

Annotate the stdlib's runtime classes

Why

Untagged variants recognized stdlib classes only by type name, with no relation between them, so a Blob case declared before a File case also caught files (#8938).

Types whose values are instances of a global class now say so with @instanceOf instead of @notUndefined, Symbol.t with @typeOf("symbol"), and File.t is a private abbreviation of Blob.t. JsError.t, Symbol.t and the Intl classes can be untagged variant cases too. Fixes #8938.

modifiedJS Blob and File cases

@unboxedtype upload = Blob(Blob.t) | File(File.t) let kind = upload =>  switch upload {  | Blob(_) => "blob"  | File(_) => "file"  }
js
Before
After
if (upload instanceof Blob) {if (upload instanceof Blob && !(upload instanceof File)) { return "blob"; return "blob";} else {} else { return "file"; return "file";}}
with Claude Opus 5.5