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> {
330330
331331
332332@available ( SwiftStdlib 5 . 5 , * )
333- var globalVar : EscapeArtist ?
333+ var globalVar : EscapeArtist ? // expected-note 2 {{var declared here}}
334334
335335@available ( SwiftStdlib 5 . 5 , * )
336336actor EscapeArtist {
@@ -340,7 +340,9 @@ actor EscapeArtist {
340340 self . x = 0
341341
342342 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}}
343344 Task { await globalVar!. isolatedMethod ( ) }
345+ // expected-warning@-1{{reference to var 'globalVar' is not concurrency-safe because it involves shared mutable state}}
344346
345347 if self . x == 0 {
346348 fatalError ( " race detected. " )
Original file line number Diff line number Diff line change 11// RUN: %target-typecheck-verify-swift -disable-availability-checking -warn-concurrency -swift-version 6
22// REQUIRES: concurrency && asserts
33
4- class Box {
4+ class Box { // expected-note 3{{class 'Box' does not conform to the `Sendable` protocol}}
55 let size : Int = 0
66}
77
You can’t perform that action at this time.
0 commit comments