We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0ab2b2a commit 00bffe1Copy full SHA for 00bffe1
1 file changed
src/compiler/checker.ts
@@ -5276,7 +5276,7 @@ namespace ts {
5276
return indexTypesIdenticalTo(IndexKind.Number, source, target);
5277
}
5278
let targetType = getIndexTypeOfType(target, IndexKind.Number);
5279
- if (targetType) {
+ if (targetType && !(targetType.flags & TypeFlags.Any)) {
5280
let sourceStringType = getIndexTypeOfType(source, IndexKind.String);
5281
let sourceNumberType = getIndexTypeOfType(source, IndexKind.Number);
5282
if (!(sourceStringType || sourceNumberType)) {
0 commit comments