* 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
30 lines
533 B
TypeScript
30 lines
533 B
TypeScript
/// <reference path="fourslash.ts" />
|
|
// @strict: true
|
|
|
|
////interface Foo {
|
|
//// a: boolean;
|
|
////}
|
|
////function partialFoo<T extends Partial<Foo>>(x: T, y: T extends { b?: boolean } ? T & { c: true } : T) {
|
|
//// return x;
|
|
////}
|
|
////
|
|
////partialFoo({ a: true, b: true }, { /*1*/ });
|
|
|
|
|
|
verify.completions({
|
|
marker: '1',
|
|
includes: [
|
|
{
|
|
sortText: completion.SortText.OptionalMember,
|
|
name: 'a'
|
|
},
|
|
{
|
|
sortText: completion.SortText.OptionalMember,
|
|
name: 'b'
|
|
},
|
|
{
|
|
name: 'c'
|
|
}
|
|
]
|
|
})
|