Skip to content

Commit b54cfc4

Browse files
committed
[Concurrency] Don't diagnose Sendable violations for error types.
1 parent df858a5 commit b54cfc4

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
@@ -1004,6 +1004,8 @@ void swift::diagnoseUnnecessaryPreconcurrencyImports(SourceFile &sf) {
10041004
static bool diagnoseSingleNonSendableType(
10051005
Type type, SendableCheckContext fromContext, SourceLoc loc,
10061006
llvm::function_ref<bool(Type, DiagnosticBehavior)> diagnose) {
1007+
if (type->hasError())
1008+
return false;
10071009

10081010
auto module = fromContext.fromDC->getParentModule();
10091011
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)