Handle the mapping between Array and ReadonlyArray in isTypeDerivedFrom

This commit is contained in:
Wesley Wigham
2020-09-16 13:31:13 -07:00
parent a5babe1c8f
commit 081f98232b
5 changed files with 71 additions and 1 deletions

View File

@@ -15349,7 +15349,7 @@ namespace ts {
source.flags & TypeFlags.InstantiableNonPrimitive ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) :
target === globalObjectType ? !!(source.flags & (TypeFlags.Object | TypeFlags.NonPrimitive)) :
target === globalFunctionType ? !!(source.flags & TypeFlags.Object) && isFunctionObjectType(source as ObjectType) :
hasBaseType(source, getTargetType(target));
hasBaseType(source, getTargetType(target)) || (isArrayType(target) && !isReadonlyArrayType(target) && isTypeDerivedFrom(source, globalReadonlyArrayType));
}
/**