mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #21866 from Microsoft/fixIndexedAccessWildcard
Fix indexed access issue with conditional types
This commit is contained in:
@@ -7991,7 +7991,7 @@ namespace ts {
|
||||
}
|
||||
if (!(indexType.flags & TypeFlags.Nullable) && isTypeAssignableToKind(indexType, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbolLike)) {
|
||||
if (isTypeAny(objectType)) {
|
||||
return anyType;
|
||||
return objectType;
|
||||
}
|
||||
const indexInfo = isTypeAssignableToKind(indexType, TypeFlags.NumberLike) && getIndexInfoOfType(objectType, IndexKind.Number) ||
|
||||
getIndexInfoOfType(objectType, IndexKind.String) ||
|
||||
|
||||
Reference in New Issue
Block a user