We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2edabe0 commit 375437eCopy full SHA for 375437e
1 file changed
src/compiler/checker.ts
@@ -7331,7 +7331,8 @@ namespace ts {
7331
return Ternary.False;
7332
}
7333
result &= related;
7334
- if (sourceProp.flags & SymbolFlags.Optional && !(targetProp.flags & SymbolFlags.Optional)) {
+ // When checking for comparability, be more lenient with optional properties.
7335
+ if (relation !== comparableRelation && sourceProp.flags & SymbolFlags.Optional && !(targetProp.flags & SymbolFlags.Optional)) {
7336
// TypeScript 1.0 spec (April 2014): 3.8.3
7337
// S is a subtype of a type T, and T is a supertype of S if ...
7338
// S' and T are object types and, for each member M in T..
0 commit comments