Skip to content

Commit 195c7b0

Browse files
authored
Merge pull request #82651 from DougGregor/fixed-synthesized-init-82168
Add already-fixed test case from #82168
2 parents 451f309 + 4586086 commit 195c7b0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/Concurrency/assume_mainactor.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,21 @@ actor MyActor2 {
215215
// NonIsolated and not if print was inferred to be main actor.
216216
print("123")
217217
}
218+
219+
// https://github.com/swiftlang/swift/issues/82168 - used to fail
220+
nonisolated protocol P {
221+
associatedtype AT
222+
static var at: AT { get }
223+
}
224+
225+
nonisolated struct KP<R: P, V> {
226+
init(keyPath: KeyPath<R, V>) {}
227+
}
228+
229+
struct S: P {
230+
let p: Int
231+
struct AT {
232+
let kp = KP(keyPath: \S.p)
233+
}
234+
static let at = AT() // used to fail here
235+
}

0 commit comments

Comments
 (0)