mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Don't fail out of use visitation when encountering an apply which uses a field of the value as an inout parameter. rdar://139666145
12 lines
201 B
Swift
12 lines
201 B
Swift
// RUN: %target-build-swift %s
|
|
|
|
struct Box<T> { var value: T }
|
|
|
|
func modify(_ string: inout String) {}
|
|
|
|
func tryConsume() {
|
|
var box = Box(value: "")
|
|
modify(&box.value)
|
|
print(consume box)
|
|
}
|