File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -330,7 +330,7 @@ struct CardboardBox<T> {
330
330
331
331
332
332
@available ( SwiftStdlib 5 . 5 , * )
333
- var globalVar : EscapeArtist ?
333
+ var globalVar : EscapeArtist ? // expected-note 2 {{var declared here}}
334
334
335
335
@available ( SwiftStdlib 5 . 5 , * )
336
336
actor EscapeArtist {
@@ -340,7 +340,9 @@ actor EscapeArtist {
340
340
self . x = 0
341
341
342
342
globalVar = self // expected-error {{this use of actor 'self' can only appear in an async initializer}}
343
+ // expected-warning@-1{{reference to var 'globalVar' is not concurrency-safe because it involves shared mutable state}}
343
344
Task { await globalVar!. isolatedMethod ( ) }
345
+ // expected-warning@-1{{reference to var 'globalVar' is not concurrency-safe because it involves shared mutable state}}
344
346
345
347
if self . x == 0 {
346
348
fatalError ( " race detected. " )
Original file line number Diff line number Diff line change 1
1
// RUN: %target-typecheck-verify-swift -disable-availability-checking -warn-concurrency -swift-version 6
2
2
// REQUIRES: concurrency && asserts
3
3
4
- class Box {
4
+ class Box { // expected-note 3{{class 'Box' does not conform to the `Sendable` protocol}}
5
5
let size : Int = 0
6
6
}
7
7
You can’t perform that action at this time.
0 commit comments