mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-15 08:20:53 -06:00
Avoid checking for optionality in comparability checks.
This commit is contained in:
parent
2edabe0ae0
commit
375437ef3c
@ -7331,7 +7331,8 @@ namespace ts {
|
||||
return Ternary.False;
|
||||
}
|
||||
result &= related;
|
||||
if (sourceProp.flags & SymbolFlags.Optional && !(targetProp.flags & SymbolFlags.Optional)) {
|
||||
// When checking for comparability, be more lenient with optional properties.
|
||||
if (relation !== comparableRelation && sourceProp.flags & SymbolFlags.Optional && !(targetProp.flags & SymbolFlags.Optional)) {
|
||||
// TypeScript 1.0 spec (April 2014): 3.8.3
|
||||
// S is a subtype of a type T, and T is a supertype of S if ...
|
||||
// S' and T are object types and, for each member M in T..
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user