Skip to content

Commit e8e27a7

Browse files
committed
add coverage for <<error-type>> + Sendable diagnostic issue
when a variable with type `<<error-type>>` was captured in a sendable function's environment, we use to emit a diagnostic about it not being sendable, but it's for a bogus type. at some point this issue disappeared as the sendable implementation evolved, but this commit adds regression coverage. resolves rdar://82452688
1 parent 58826ed commit e8e27a7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/Concurrency/sendable_checking.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,13 @@ public actor MyActor: MyProto {
7373
public func foo<F>(aFoo: F) async where F: Sendable { }
7474
public func bar<B>(aBar: B) async where B: Sendable { }
7575
}
76+
77+
// rdar://82452688 - make sure sendable checking doesn't fire for a capture
78+
// of a value of error-type
79+
@available(SwiftStdlib 5.1, *)
80+
func f() async {
81+
let n = wobble() // expected-error{{cannot find 'wobble' in scope}}
82+
@Sendable func nested() {
83+
n.pointee += 1
84+
}
85+
}

0 commit comments

Comments
 (0)