42a2d9e568
Previously it did not, causing misleading excess property errors. Note that assignability errors with conditional types are still usually confusing. This PR doesn't address that. Also, make sure that exact matches in getSpellingSuggestion are skipped.
10 lines
308 B
TypeScript
10 lines
308 B
TypeScript
type Something<T> = { test: string } & (T extends object ? {
|
|
arg: T
|
|
} : {
|
|
arg?: undefined
|
|
});
|
|
|
|
function testFunc2<A extends object>(a: A, sa: Something<A>) {
|
|
sa = { test: 'hi', arg: a }; // not excess (but currently still not assignable)
|
|
sa = { test: 'bye', arg: a, arr: a } // excess
|
|
}
|