mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-10 18:04:18 -05:00
Exclude special index signature rule from strict subtype relation (#53388)
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
This commit is contained in:
@@ -22485,7 +22485,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
const targetHasStringIndex = some(indexInfos, info => info.keyType === stringType);
|
||||
let result = Ternary.True;
|
||||
for (const targetInfo of indexInfos) {
|
||||
const related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & TypeFlags.Any ? Ternary.True :
|
||||
const related = relation !== strictSubtypeRelation && !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & TypeFlags.Any ? Ternary.True :
|
||||
isGenericMappedType(source) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, RecursionFlags.Both, reportErrors) :
|
||||
typeRelatedToIndexInfo(source, targetInfo, reportErrors, intersectionState);
|
||||
if (!related) {
|
||||
|
||||
Reference in New Issue
Block a user