Skip to content

Commit de914f6

Browse files
committed
only report the error on IndexedAccessType nodes
1 parent 020ad07 commit de914f6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19584,7 +19584,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1958419584
if (objectType === wildcardType || indexType === wildcardType) {
1958519585
return wildcardType;
1958619586
}
19587-
if (isGenericObjectType(objectType)) {
19587+
if (accessNode?.kind === SyntaxKind.IndexedAccessType && isGenericObjectType(objectType)) {
1958819588
const propertyName = getPropertyNameFromIndex(indexType, accessNode);
1958919589
if (propertyName) {
1959019590
if (someType(getApparentType(objectType), t => isNonPublicPropertyOfType(t, propertyName))) {

0 commit comments

Comments
 (0)