We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
IndexedAccessType
1 parent 020ad07 commit de914f6Copy full SHA for de914f6
1 file changed
src/compiler/checker.ts
@@ -19584,7 +19584,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
19584
if (objectType === wildcardType || indexType === wildcardType) {
19585
return wildcardType;
19586
}
19587
- if (isGenericObjectType(objectType)) {
+ if (accessNode?.kind === SyntaxKind.IndexedAccessType && isGenericObjectType(objectType)) {
19588
const propertyName = getPropertyNameFromIndex(indexType, accessNode);
19589
if (propertyName) {
19590
if (someType(getApparentType(objectType), t => isNonPublicPropertyOfType(t, propertyName))) {
0 commit comments