Skip to content

Commit 261c04c

Browse files
committed
Sema: Tiny cleanup in ConstraintSystem::getTypeOfReference()
1 parent 00fd686 commit 261c04c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,8 +1714,7 @@ ConstraintSystem::getTypeOfReference(ValueDecl *value,
17141714

17151715
if (Context.LangOpts.hasFeature(Feature::InferSendableFromCaptures)) {
17161716
// All global functions should be @Sendable
1717-
if (!funcDecl->getDeclContext()->isTypeContext() &&
1718-
!funcDecl->getDeclContext()->isLocalContext()) {
1717+
if (funcDecl->getDeclContext()->isModuleScopeContext()) {
17191718
funcType =
17201719
funcType->withExtInfo(funcType->getExtInfo().withConcurrent());
17211720
}
@@ -1740,7 +1739,8 @@ ConstraintSystem::getTypeOfReference(ValueDecl *value,
17401739
if (isForCodeCompletion() && openedType->hasError()) {
17411740
// In code completion, replace error types by placeholder types so we can
17421741
// match the types we know instead of bailing out completely.
1743-
openedType = replaceParamErrorTypeByPlaceholder(openedType, value, /*hasAppliedSelf=*/true);
1742+
openedType = replaceParamErrorTypeByPlaceholder(
1743+
openedType, value, /*hasAppliedSelf=*/true);
17441744
}
17451745

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

0 commit comments

Comments
 (0)