tsdjs / tsd

Check TypeScript type definitions
MIT License
2.4k stars 67 forks source link

expectType fails for two identical types that are differently implemented #218

Open maximzavadskiy opened 3 months ago

maximzavadskiy commented 3 months ago
type typeA = {a: number} & {b: number}
type typeB = {a: number; b: number}
declare const b:typeB
expectType<typeA>(b) // ERR!  but expected to pass

With this behaviour more complex types/types that are computed cannot be checked via tsd

maximzavadskiy commented 3 months ago

import {Equals} from "tsafe" works as expected