File tree Expand file tree Collapse file tree 3 files changed +5
-121
lines changed
tests/baselines/reference Expand file tree Collapse file tree 3 files changed +5
-121
lines changed Original file line number Diff line number Diff line change @@ -8119,6 +8119,9 @@ namespace ts {
81198119 }
81208120 return indexInfo.type;
81218121 }
8122+ if (indexType.flags & TypeFlags.Never) {
8123+ return neverType;
8124+ }
81228125 if (accessExpression && !isConstEnumObjectType(objectType)) {
81238126 if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) {
81248127 if (getIndexTypeOfType(objectType, IndexKind.Number)) {
@@ -8131,9 +8134,6 @@ namespace ts {
81318134 return anyType;
81328135 }
81338136 }
8134- if (indexType.flags & TypeFlags.Never) {
8135- return neverType;
8136- }
81378137 if (accessNode) {
81388138 const indexNode = accessNode.kind === SyntaxKind.ElementAccessExpression ? accessNode.argumentExpression : accessNode.indexType;
81398139 if (indexType.flags & (TypeFlags.StringLiteral | TypeFlags.NumberLiteral)) {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -117,8 +117,8 @@ declare const key: never
117117>key : never
118118
119119const result6 = obj[key]
120- >result6 : any
121- >obj[key] : any
120+ >result6 : never
121+ >obj[key] : never
122122>obj : { a: string; b: number; }
123123>key : never
124124
You can’t perform that action at this time.
0 commit comments