Files
swift-mirror/validation-test/SILOptimizer/rdar139666145.swift
Nate Chandler 1765f0b1e0 [MoveOnly] Fix consume of addr with mutated field.
Don't fail out of use visitation when encountering an apply which uses a
field of the value as an inout parameter.

rdar://139666145
2025-05-15 15:19:26 -07:00

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)
}