Files
swift-mirror/test/refactoring/SyntacticRename/Outputs/property-wrapper-init/init.swift.expected
Alex Hoppen 4103ad8cea [SourceKit] Change tests to use find-rename-ranges instead of syntactic-rename
I will remove the `syntactic-rename` refactoring action in a follow-up commit. Clients should always ask for rename ranges and perform the rename by themselves instead of asking for a renamed file.
2023-11-15 11:20:27 -08:00

38 lines
1.1 KiB
Plaintext

public struct Outer {
@propertyWrapper
public struct InnerWrapper<T> {
public var wrappedValue: T
public /*init:def*/<keywordBase>init</keywordBase>(<arglabel index=0>initialValue</arglabel><param index=0></param>: T) {
self.wrappedValue = initialValue
}
public /*body:def*/init(first: Int, body: () -> T) {
self.wrappedValue = body()
}
}
}
var globalInt: Int { return 17 }
public struct HasWrappers {
@Outer.InnerWrapper
public var x: Int = globalInt
@Outer . /*body:call*/InnerWrapper(first: 20, body: { globalInt })
public var y: Int
@Outer . /*body:call*/InnerWrapper(first: 10, body: {
struct Inner {
@Outer . /*init:call*/InnerWrapper(<callarg index=0>initialValue</callarg><callcolon index=0>: </callcolon>globalInt)
var x: Int
}
return Inner().x + globalInt
})
public var z: Int
}
func uses() {
_ = Outer . /*body:call*/InnerWrapper(first: 42, body: { 45 })
_ = Outer . /*init:call*/InnerWrapper(<callarg index=0>initialValue</callarg><callcolon index=0>: </callcolon>0)
}