Make undefined and null assignable to each other

This commit is contained in:
Anders Hejlsberg 2016-02-15 09:23:40 -08:00
parent 26e371d7bd
commit 98b6a5ad11

View File

@ -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)) {