Files
swift-mirror/test/refactoring/SyntacticRename/Outputs/custom-attrs/Other.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

60 lines
1.3 KiB
Plaintext

@propertyWrapper
struct /*wrapper:def*/Foo<T> {
public var wrappedValue: T
init(initialValue: T) {
wrappedValue = initialValue
}
init(initialValue: T, otherThing: Bool) {
self.init(initialValue: initialValue)
}
var projectedValue: Projection<T> {
get { Projection(item: wrappedValue) }
}
}
struct Projection<T> {
var item: T
}
@resultBuilder
struct /*builder:def*/<base>Other</base> {
public static func buildBlock(_ components: String...) -> String {
return components.joined()
}
}
struct Bar {
@/*wrapper*/Foo
var /*wrapped:def*/foo: Int = 10
@/*wrapper*/Foo(initialValue: "hello")
var bar: String
@/*wrapper*/Foo
var jim: String = {
struct Bar {
@/*wrapper*/Foo
var inner: String = "It's 42"
}
return Bar().inner
}()
func combined(@/*builder*/<base>Other</base> _ a: () -> String) -> String {
return a()
}
@/*builder*/<base>Other</base>
func hello() -> String {
"hello"
"there"
}
func baz() {
let _: /*wrapper*/Foo<Int> = /*wrapped+1*/_foo
let _: Int = /*wrapped+1*/_foo.wrappedValue
let _: Int = /*wrapped*/foo
let _: Projection<Int> = /*wrapped+1*/$foo
let _: /*wrapper*/Foo<String> = _bar
}
}