forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request swiftlang#59702 from DougGregor/assocated-type-sen…
…dable
- Loading branch information
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// RUN: %target-typecheck-verify-swift -strict-concurrency=complete | ||
// REQUIRES: concurrency | ||
|
||
class C1 { } // expected-note{{class 'C1' does not conform to the 'Sendable' protocol}} | ||
@_nonSendable class C2 { } // expected-note{{conformance of 'C2' to 'Sendable' has been explicitly marked unavailable here}} | ||
|
||
protocol TestProtocol { | ||
associatedtype Value: Sendable | ||
} | ||
|
||
struct Test1: TestProtocol { // expected-warning{{type 'Test1.Value' (aka 'C1') does not conform to the 'Sendable' protocol}} | ||
typealias Value = C1 | ||
} | ||
|
||
struct Test2: TestProtocol { // expected-warning{{conformance of 'C2' to 'Sendable' is unavailable}} | ||
// expected-note@-1{{in associated type 'Self.Value' (inferred as 'C2')}} | ||
typealias Value = C2 | ||
} |