Skip to content

Commit f326cbf

Browse files
authored
Add a test for optional members completions within an object within an index signature constraint (microsoft#52149)
1 parent 2c1fda2 commit f326cbf

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/// <reference path="fourslash.ts" />
2+
// @strict: true
3+
////
4+
//// repro #9900
5+
////
6+
//// interface Test {
7+
//// a?: number;
8+
//// b?: string;
9+
//// }
10+
////
11+
//// interface TestIndex {
12+
//// [key: string]: Test;
13+
//// }
14+
////
15+
//// declare function testFunc<T extends TestIndex>(t: T): void;
16+
////
17+
//// testFunc({
18+
//// test: {
19+
//// /**/
20+
//// },
21+
//// });
22+
23+
verify.completions({
24+
marker: '',
25+
exact: [
26+
{ name: 'a', sortText: completion.SortText.OptionalMember },
27+
{ name: 'b', sortText: completion.SortText.OptionalMember },
28+
]
29+
});

0 commit comments

Comments
 (0)