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> => xdiagnostic
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