Skip to content

Commit 833e2a3

Browse files
committed
check whether result type has an error or not
1 parent f633505 commit 833e2a3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,11 +1183,12 @@ bool swift::diagnoseNonSendableTypesInReference(
11831183
// Check the result type of a function.
11841184
if (auto func = dyn_cast<FuncDecl>(function)) {
11851185
if (funcCheckOptions.contains(FunctionCheckKind::Results)) {
1186-
if (func->hasSendingResult())
1187-
return true;
1188-
11891186
// only check results if funcCheckKind specifies so
11901187
Type resultType = func->getResultInterfaceType().subst(subs);
1188+
1189+
if (func->hasSendingResult() && !resultType->hasError())
1190+
return true;
1191+
11911192
if (diagnoseNonSendableTypes(
11921193
resultType, fromDC, derivedConformanceType,
11931194
refLoc, diagnoseLoc.isInvalid() ? refLoc : diagnoseLoc,

0 commit comments

Comments
 (0)