mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Enable walking into `TypeOffsetSizePair`s from an existential into an archetype. And set the access kind on `open_existential_addr` instructions which are the sources of rewritten `copy_addr`s to mutable. rdar://141279635
22 lines
330 B
Swift
22 lines
330 B
Swift
// RUN: %target-build-swift %s
|
|
|
|
protocol P: ~Copyable {
|
|
var property: Bool { get }
|
|
consuming func function()
|
|
}
|
|
|
|
struct S: P, ~Copyable {
|
|
var property: Bool { false }
|
|
consuming func function() {}
|
|
}
|
|
|
|
func g(s: consuming any P & ~Copyable) {
|
|
let s = s
|
|
s.function()
|
|
}
|
|
|
|
func f() {
|
|
let s = S()
|
|
g(s: s)
|
|
}
|