From a612ab43f4b907c85b5d819b1ffd3e5bd75f6a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Sun, 8 Jan 2023 22:01:37 +0100 Subject: [PATCH] Add a test for optional members completions within an object within an index signature constraint --- .../completionsIndexSignatureConstraint1.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/cases/fourslash/completionsIndexSignatureConstraint1.ts diff --git a/tests/cases/fourslash/completionsIndexSignatureConstraint1.ts b/tests/cases/fourslash/completionsIndexSignatureConstraint1.ts new file mode 100644 index 0000000000000..7e67ee8db828a --- /dev/null +++ b/tests/cases/fourslash/completionsIndexSignatureConstraint1.ts @@ -0,0 +1,29 @@ +/// +// @strict: true +//// +//// repro #9900 +//// +//// interface Test { +//// a?: number; +//// b?: string; +//// } +//// +//// interface TestIndex { +//// [key: string]: Test; +//// } +//// +//// declare function testFunc(t: T): void; +//// +//// testFunc({ +//// test: { +//// /**/ +//// }, +//// }); + +verify.completions({ + marker: '', + exact: [ + { name: 'a', sortText: completion.SortText.OptionalMember }, + { name: 'b', sortText: completion.SortText.OptionalMember }, + ] +}); \ No newline at end of file