Skip to content

Commit 994a601

Browse files
committed
Update diagnostics based on Swift 6 changes
1 parent 725624f commit 994a601

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

test/Concurrency/actor_definite_init_swift6.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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, *)
336336
actor 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.")

test/Concurrency/actor_keypath_isolation_swift6.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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

0 commit comments

Comments
 (0)