mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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.
41 lines
717 B
Plaintext
41 lines
717 B
Plaintext
var /*var-y:def*/y = 3
|
|
/*var-y*/y = /*var-y*/y + 2 + /*var-y*/y
|
|
|
|
struct Struct {
|
|
let /*ivar-x:def*/x: Int
|
|
var y: Int
|
|
|
|
func sum() -> Int {
|
|
return /*ivar-x*/x + y
|
|
}
|
|
}
|
|
|
|
let aStruct = Struct(x: 10, y: 11)
|
|
print(aStruct . /*ivar-x*/x + aStruct.y)
|
|
var cat = {(a: Int) in aStruct . /*ivar-x*/x}
|
|
|
|
var aTuple = (1, 1)
|
|
|
|
switch aTuple {
|
|
case (let /*pattern-a:def*/a, let b):
|
|
print(/*pattern-a*/a + b)
|
|
}
|
|
|
|
var opt = Optional.some(1)
|
|
var opt2 = Optional.some(2)
|
|
|
|
if let i = opt, let /*var-j:def*/<base>j</base> = opt2 {
|
|
print(i + /*var-j*/<base>j</base>)
|
|
}
|
|
|
|
var (a, /*pattern-b:def*/b) = (1, 2)
|
|
print(a + /*pattern-b*/b)
|
|
|
|
struct S {
|
|
lazy var lazyVal: Int = {
|
|
let /*lazy:def*/myVal = 0
|
|
return /*lazy:ref*/myVal
|
|
}()
|
|
}
|
|
|