diff --git a/src/services/completions.ts b/src/services/completions.ts
index b75563e87ce..75ec22e3528 100644
--- a/src/services/completions.ts
+++ b/src/services/completions.ts
@@ -2938,7 +2938,7 @@ function getContextualType(previousToken: Node, position: number, sourceFile: So
isEqualityOperatorKind(previousToken.kind) && isBinaryExpression(parent) && isEqualityOperatorKind(parent.operatorToken.kind) ?
// completion at `x ===/**/` should be for the right side
checker.getTypeAtLocation(parent.left) :
- checker.getContextualType(previousToken as Expression);
+ checker.getContextualType(previousToken as Expression, ContextFlags.Completions) || checker.getContextualType(previousToken as Expression);
}
}
diff --git a/tests/cases/fourslash/completionEntryForArgumentConstrainedToString.ts b/tests/cases/fourslash/completionEntryForArgumentConstrainedToString.ts
new file mode 100644
index 00000000000..49eb853a37d
--- /dev/null
+++ b/tests/cases/fourslash/completionEntryForArgumentConstrainedToString.ts
@@ -0,0 +1,8 @@
+///
(p: P): void;
+////
+//// test(/*ts*/)
+////
+
+verify.completions({ marker: ["ts"], includes: ['"a"', '"b"'], isNewIdentifierLocation: true });
diff --git a/tests/cases/fourslash/completionEntryForArrayElementConstrainedToString.ts b/tests/cases/fourslash/completionEntryForArrayElementConstrainedToString.ts
new file mode 100644
index 00000000000..41778c5089f
--- /dev/null
+++ b/tests/cases/fourslash/completionEntryForArrayElementConstrainedToString.ts
@@ -0,0 +1,7 @@
+/// (p: { type: P }): void;
+////
+//// test({ type: /*ts*/ })
+
+verify.completions({ marker: ["ts"], includes: ['"a"', '"b"'], isNewIdentifierLocation: false });
diff --git a/tests/cases/fourslash/completionsLiteralFromInferenceWithinInferredType1.ts b/tests/cases/fourslash/completionsLiteralFromInferenceWithinInferredType1.ts
index 8e2550d1a57..584ea46b6ed 100644
--- a/tests/cases/fourslash/completionsLiteralFromInferenceWithinInferredType1.ts
+++ b/tests/cases/fourslash/completionsLiteralFromInferenceWithinInferredType1.ts
@@ -13,5 +13,13 @@
//// b: "/*ts*/",
//// },
//// });
+////
+//// test({
+//// foo: {},
+//// bar: {
+//// b: /*ts2*/,
+//// },
+//// });
verify.completions({ marker: ["ts"], exact: ["foo", "bar"] });
+verify.completions({ marker: ["ts2"], includes: ['"foo"', '"bar"'], isNewIdentifierLocation: false });
diff --git a/tests/cases/fourslash/completionsLiteralFromInferenceWithinInferredType3.ts b/tests/cases/fourslash/completionsLiteralFromInferenceWithinInferredType3.ts
index 9cbe1777324..dfb4417cf8a 100644
--- a/tests/cases/fourslash/completionsLiteralFromInferenceWithinInferredType3.ts
+++ b/tests/cases/fourslash/completionsLiteralFromInferenceWithinInferredType3.ts
@@ -12,5 +12,13 @@
//// b: ["/*ts*/"],
//// },
//// });
+////
+//// test({
+//// foo: {},
+//// bar: {
+//// b: [/*ts2*/],
+//// },
+//// });
verify.completions({ marker: ["ts"], exact: ["foo", "bar"] });
+verify.completions({ marker: ["ts2"], includes: ['"foo"', '"bar"'], isNewIdentifierLocation: true });