Skip to content

Commit fb3ad9a

Browse files
committed
Sema: Tiny cleanup in ConstraintSystem::getTypeOfReference()
1 parent f96ab36 commit fb3ad9a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: lib/Sema/ConstraintSystem.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1823,8 +1823,7 @@ ConstraintSystem::getTypeOfReference(ValueDecl *value,
18231823

18241824
if (Context.LangOpts.hasFeature(Feature::InferSendableFromCaptures)) {
18251825
// All global functions should be @Sendable
1826-
if (!funcDecl->getDeclContext()->isTypeContext() &&
1827-
!funcDecl->getDeclContext()->isLocalContext()) {
1826+
if (funcDecl->getDeclContext()->isModuleScopeContext()) {
18281827
funcType =
18291828
funcType->withExtInfo(funcType->getExtInfo().withConcurrent());
18301829
}
@@ -1849,7 +1848,8 @@ ConstraintSystem::getTypeOfReference(ValueDecl *value,
18491848
if (isForCodeCompletion() && openedType->hasError()) {
18501849
// In code completion, replace error types by placeholder types so we can
18511850
// match the types we know instead of bailing out completely.
1852-
openedType = replaceParamErrorTypeByPlaceholder(openedType, value, /*hasAppliedSelf=*/true);
1851+
openedType = replaceParamErrorTypeByPlaceholder(
1852+
openedType, value, /*hasAppliedSelf=*/true);
18531853
}
18541854

18551855
// If we opened up any type variables, record the replacements.

0 commit comments

Comments
 (0)