Add a test for optional members completions within an object within an index signature constraint (#52149)

This commit is contained in:
Mateusz Burzyński 2023-01-09 20:06:07 +01:00 committed by GitHub
parent 2c1fda249f
commit f326cbfb2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,29 @@
/// <reference path="fourslash.ts" />
// @strict: true
////
//// repro #9900
////
//// interface Test {
//// a?: number;
//// b?: string;
//// }
////
//// interface TestIndex {
//// [key: string]: Test;
//// }
////
//// declare function testFunc<T extends TestIndex>(t: T): void;
////
//// testFunc({
//// test: {
//// /**/
//// },
//// });
verify.completions({
marker: '',
exact: [
{ name: 'a', sortText: completion.SortText.OptionalMember },
{ name: 'b', sortText: completion.SortText.OptionalMember },
]
});