TypeScript/tests/cases/fourslash/completionsWithOptionalPropertiesGeneric.ts
Andrew Branch a95a25b9a7
Fix completions of optional properties in generic positions (#33937)
* fixes #30507

* Add test case for generic Partial type

* Fixes #28470

* Simplify contextFlags binary check

* Add string literal completion test

* Fix ContextFlags typings

* Speed up inference expression for completion

* Fix baseline merge

* Make contextFlags internal

* Reapply readonly array changes

* accept baselines

* Fix generic completion tests

* Re-merge ContextFlags

* Don’t change type during inference

* Fix typos and superfluous undefined arguments

* Add test for completions in unconstrained generic object literal
2019-10-17 10:45:40 -07:00

20 lines
389 B
TypeScript

/// <reference path="fourslash.ts" />
// @strict: true
//// interface MyOptions {
//// hello?: boolean;
//// world?: boolean;
//// }
//// declare function bar<T extends MyOptions>(options?: Partial<T>): void;
//// bar({ hello, /*1*/ });
verify.completions({
marker: '1',
includes: [
{
sortText: completion.SortText.OptionalMember,
name: 'world'
},
]
})