diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 9f77641faf5cc..2f943279c999f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -20358,7 +20358,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined)) return Ternary.True; if (source.flags & TypeFlags.StructuredOrInstantiable || target.flags & TypeFlags.StructuredOrInstantiable) { - const isPerformingExcessPropertyChecks = !(intersectionState & IntersectionState.Target) && (isObjectLiteralType(source) && getObjectFlags(source) & ObjectFlags.FreshLiteral); + const isPerformingExcessPropertyChecks = !isFromInferenceBlockedSource(source) && !(intersectionState & IntersectionState.Target) && (isObjectLiteralType(source) && getObjectFlags(source) & ObjectFlags.FreshLiteral); if (isPerformingExcessPropertyChecks) { if (hasExcessProperties(source as FreshObjectLiteralType, target, reportErrors)) { if (reportErrors) { diff --git a/tests/cases/fourslash/noErrorsAfterCompletionsRequestWithinGenericFunction1.ts b/tests/cases/fourslash/noErrorsAfterCompletionsRequestWithinGenericFunction1.ts new file mode 100644 index 0000000000000..0ef19b43fcbd4 --- /dev/null +++ b/tests/cases/fourslash/noErrorsAfterCompletionsRequestWithinGenericFunction1.ts @@ -0,0 +1,9 @@ +/// +// @strict: true +//// +//// declare function func(arg: T): void; +//// func({ foo: 1, bar/*1*/: 1 }); + +goTo.marker("1"); +verify.completions({ exact: undefined }); +verify.noErrors(); diff --git a/tests/cases/fourslash/noErrorsAfterCompletionsRequestWithinGenericFunction2.ts b/tests/cases/fourslash/noErrorsAfterCompletionsRequestWithinGenericFunction2.ts new file mode 100644 index 0000000000000..6069ac397fdb7 --- /dev/null +++ b/tests/cases/fourslash/noErrorsAfterCompletionsRequestWithinGenericFunction2.ts @@ -0,0 +1,12 @@ +/// +// @strict: true +//// +//// // repro from #50818#issuecomment-1278324638 +//// +//// declare function func(arg: T): void; +//// func({ foo: 1, bar/*1*/: 1 }); + +goTo.marker("1"); +edit.insert("2"); +verify.completions({ exact: undefined }); +verify.noErrors();