Semantic Diff

#9054 Print a type reached through a module alias once in type errors

1 commit

61cfc5e9e4dbed3d43659df19e9e2c82ee803ac9..pr-9054

b0dbdd912 · cknitt + Claude · Oct 26, 2026, 13:26 UTC

Print a type reached through a module alias once in type errors

Why

The check for whether to print a type's expansion compared paths without resolving module aliases, so Map.t was printed again as its identical-looking expansion Stdlib_Map.t.

modifiedDiagnostic type mismatch

let f = (x: Map.t<string, int>): Map.t<string, string> => x
diagnostic
Before
After
This has type: Map.t<string, int> (defined as Map.t<string, int>)But it's expected to have type: Map.t<string, string> (defined as Map.t<string, string>)This has type: Map.t<string, int>But it's expected to have type: Map.t<string, string>

modifiedDiagnostic coercion

module Inner = {  type t<'a>}module A = Innerlet m = (x: A.t<[#X]>) => (x :> A.t<[#X | #Y]>)
diagnostic
Before
After
Type A.t<[#X]> = Inner.t<[#X]> is not a subtype of A.t<[#X | #Y]> = Inner.t<[#X | #Y]>Type A.t<[#X]> is not a subtype of A.t<[#X | #Y]>

Fixes #8997