You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
getPropertiesOfUnionOrIntersectionType: handle types with index signature (#31979)
* getPropertiesOfUnionOrIntersectionType: handle types with index signature
Fixes: #31565
* fix test
* more testing
* fix typo in checker.ts
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
Copy file name to clipboardExpand all lines: tests/cases/fourslash/completionEntryForUnionProperty2.ts
+12-3Lines changed: 12 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -3,21 +3,30 @@
3
3
////interface One {
4
4
//// commonProperty: string;
5
5
//// commonFunction(): number;
6
+
//// anotherProperty: Record<string, number>;
6
7
////}
7
8
////
8
9
////interface Two {
9
10
//// commonProperty: number;
10
11
//// commonFunction(): number;
12
+
//// anotherProperty: { foo: number }
11
13
////}
12
14
////
13
15
////var x : One | Two;
14
16
////
15
-
////x.commonProperty./**/
17
+
////x.commonProperty./*1*/;
18
+
////x.anotherProperty./*2*/;
16
19
17
20
verify.completions({
18
-
marker: "",
21
+
marker: "1",
19
22
exact: [
20
-
{name: "toString",text: "(method) toString(): string (+1 overload)",documentation: "Returns a string representation of a string.",},
23
+
{name: "toString",text: "(method) toString(): string (+1 overload)",documentation: "Returns a string representation of a string."},
21
24
{name: "valueOf",text: "(method) valueOf(): string | number",documentation: "Returns the primitive value of the specified object."},
25
+
{name: "toLocaleString",text: "(method) toLocaleString(): string (+1 overload)",documentation: "Returns a date converted to a string using the current locale."},
0 commit comments