File tree Expand file tree Collapse file tree 3 files changed +13
-13
lines changed
tests/baselines/reference Expand file tree Collapse file tree 3 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -9795,7 +9795,7 @@ namespace ts {
9795
9795
}
9796
9796
9797
9797
const propType = getTypeOfSymbol(prop);
9798
- if (node.kind !== SyntaxKind.PropertyAccessExpression || !(prop.flags & (SymbolFlags.Variable | SymbolFlags.Property)) || isAssignmentTarget(node)) {
9798
+ if (node.kind !== SyntaxKind.PropertyAccessExpression || !(prop.flags & (SymbolFlags.Variable | SymbolFlags.Property | SymbolFlags.Accessor )) || isAssignmentTarget(node)) {
9799
9799
return propType;
9800
9800
}
9801
9801
const leftmostNode = getLeftmostIdentifierOrThis(node);
Original file line number Diff line number Diff line change @@ -57,18 +57,18 @@ class C1 {
57
57
>pp2 : string
58
58
59
59
strOrNum = typeof this.pp3 === "string" && this.pp3; // string | number
60
- >strOrNum = typeof this.pp3 === "string" && this.pp3 : string | number
60
+ >strOrNum = typeof this.pp3 === "string" && this.pp3 : string
61
61
>strOrNum : string | number
62
- >typeof this.pp3 === "string" && this.pp3 : string | number
62
+ >typeof this.pp3 === "string" && this.pp3 : string
63
63
>typeof this.pp3 === "string" : boolean
64
64
>typeof this.pp3 : string
65
65
>this.pp3 : string | number
66
66
>this : this
67
67
>pp3 : string | number
68
68
>"string" : string
69
- >this.pp3 : string | number
69
+ >this.pp3 : string
70
70
>this : this
71
- >pp3 : string | number
71
+ >pp3 : string
72
72
}
73
73
}
74
74
var c1: C1;
@@ -90,18 +90,18 @@ strOrNum = typeof c1.pp2 === "string" && c1.pp2; // string | number
90
90
>pp2 : string
91
91
92
92
strOrNum = typeof c1.pp3 === "string" && c1.pp3; // string | number
93
- >strOrNum = typeof c1.pp3 === "string" && c1.pp3 : string | number
93
+ >strOrNum = typeof c1.pp3 === "string" && c1.pp3 : string
94
94
>strOrNum : string | number
95
- >typeof c1.pp3 === "string" && c1.pp3 : string | number
95
+ >typeof c1.pp3 === "string" && c1.pp3 : string
96
96
>typeof c1.pp3 === "string" : boolean
97
97
>typeof c1.pp3 : string
98
98
>c1.pp3 : string | number
99
99
>c1 : C1
100
100
>pp3 : string | number
101
101
>"string" : string
102
- >c1.pp3 : string | number
102
+ >c1.pp3 : string
103
103
>c1 : C1
104
- >pp3 : string | number
104
+ >pp3 : string
105
105
106
106
var obj1: {
107
107
>obj1 : { x: string | number; }
Original file line number Diff line number Diff line change @@ -172,16 +172,16 @@ strOrNum = typeof obj1.method(strOrNum) === "string" && obj1.method(strOrNum);
172
172
173
173
// accessing getter property
174
174
strOrNum = typeof obj1.prop === "string" && obj1.prop;
175
- >strOrNum = typeof obj1.prop === "string" && obj1.prop : string | number
175
+ >strOrNum = typeof obj1.prop === "string" && obj1.prop : string
176
176
>strOrNum : string | number
177
- >typeof obj1.prop === "string" && obj1.prop : string | number
177
+ >typeof obj1.prop === "string" && obj1.prop : string
178
178
>typeof obj1.prop === "string" : boolean
179
179
>typeof obj1.prop : string
180
180
>obj1.prop : string | number
181
181
>obj1 : { method(param: string | number): string | number; prop: string | number; }
182
182
>prop : string | number
183
183
>"string" : string
184
- >obj1.prop : string | number
184
+ >obj1.prop : string
185
185
>obj1 : { method(param: string | number): string | number; prop: string | number; }
186
- >prop : string | number
186
+ >prop : string
187
187
You can’t perform that action at this time.
0 commit comments