mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Make undefined and null assignable to each other
This commit is contained in:
1 parent
26e371d7bd
commit
98b6a5ad11
1 file changed
+1
-2
@@ -5415,8 +5415,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
if (isTypeAny(target)) return Ternary.True;
|
||||
if (source === undefinedType) return Ternary.True;
|
||||
if (source === nullType && target !== undefinedType) return Ternary.True;
|
||||
if (source.flags & TypeFlags.Undefined) return Ternary.True;
|
||||
if (source.flags & TypeFlags.Enum && target === numberType) return Ternary.True;
|
||||
if (source.flags & TypeFlags.Enum && target.flags & TypeFlags.Enum) {
|
||||
if (result = enumRelatedTo(source, target)) {
|
||||
|
||||
Reference in new issue
Block a user