Skip to content

Commit ab45e35

Browse files
authored
Merge pull request #70581 from hborla/error-type-sendable
[Concurrency] Don't diagnose `Sendable` violations for error types.
2 parents 29926a7 + b54cfc4 commit ab45e35

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,8 @@ static bool diagnoseSingleNonSendableType(
10051005
Type type, SendableCheckContext fromContext,
10061006
Type inDerivedConformance, SourceLoc loc,
10071007
llvm::function_ref<bool(Type, DiagnosticBehavior)> diagnose) {
1008+
if (type->hasError())
1009+
return false;
10081010

10091011
auto module = fromContext.fromDC->getParentModule();
10101012
auto nominal = type->getAnyNominal();

test/Concurrency/sendable_checking_errors.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ func f() async {
1414
n.pointee += 1
1515
}
1616
}
17+
18+
struct S: Sendable {
19+
var b: Undefined // expected-error{{cannot find type 'Undefined' in scope}}
20+
}

0 commit comments

Comments
 (0)