mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Do not report errors when inference is partially blocked (#52728)
This commit is contained in:
committed by
GitHub
parent
4b534dc859
commit
879dbcd2df
@@ -0,0 +1,9 @@
|
||||
///<reference path="fourslash.ts"/>
|
||||
// @strict: true
|
||||
////
|
||||
//// declare function func<T extends { foo: 1 }>(arg: T): void;
|
||||
//// func({ foo: 1, bar/*1*/: 1 });
|
||||
|
||||
goTo.marker("1");
|
||||
verify.completions({ exact: undefined });
|
||||
verify.noErrors();
|
||||
@@ -0,0 +1,12 @@
|
||||
///<reference path="fourslash.ts"/>
|
||||
// @strict: true
|
||||
////
|
||||
//// // repro from #50818#issuecomment-1278324638
|
||||
////
|
||||
//// declare function func<T extends { foo: 1 }>(arg: T): void;
|
||||
//// func({ foo: 1, bar/*1*/: 1 });
|
||||
|
||||
goTo.marker("1");
|
||||
edit.insert("2");
|
||||
verify.completions({ exact: undefined });
|
||||
verify.noErrors();
|
||||
@@ -0,0 +1,25 @@
|
||||
///<reference path="fourslash.ts"/>
|
||||
// @strict: true
|
||||
////
|
||||
//// // repro from #52580#issuecomment-1416131055
|
||||
////
|
||||
//// type Funcs<A, B extends Record<string, unknown>> = {
|
||||
//// [K in keyof B]: {
|
||||
//// fn: (a: A, b: B) => void;
|
||||
//// thing: B[K];
|
||||
//// }
|
||||
//// }
|
||||
////
|
||||
//// function foo<A, B extends Record<string, unknown>>(fns: Funcs<A, B>) {}
|
||||
////
|
||||
//// foo({
|
||||
//// bar: { fn: (a: string, b) => {}, thing: "asd" },
|
||||
//// /*1*/
|
||||
//// });
|
||||
|
||||
goTo.marker("1");
|
||||
const markerPosition = test.markers()[0].position;
|
||||
edit.paste(`bar: { fn: (a: string, b) => {}, thing: "asd" },`)
|
||||
edit.replace(markerPosition + 4, 1, 'z')
|
||||
verify.completions({ isNewIdentifierLocation: true });
|
||||
verify.noErrors();
|
||||
Reference in New Issue
Block a user