Files
swift-mirror/test/refactoring/rename/Outputs/local/param_2.swift.expected
Alex Hoppen 5ed83ff616 [SourceKit] Update tests to use find-local-rename-ranges instead of invoking the local rename refactoring action
The local rename refactoring action will be removed in a follow-up commit.
2023-11-15 11:20:26 -08:00

58 lines
849 B
Plaintext

func test1() {
if true {
let x = 1
print(x)
} else {
let x = 2
print(x)
}
}
func test2(arg1: Int?, arg2: (Int, String)?) {
if let x = arg1 {
print(x)
} else if let (x, y) = arg2 {
print(x, y)
}
}
func test3(arg: Int?) {
switch arg {
case let .some(x) where x == 0:
print(x)
case let .some(x) where x == 1,
let .some(x) where x == 2:
print(x)
fallthrough
case let .some(x) where x == 3:
print(x)
default:
break
}
}
struct Err1 : Error { }
func test4(arg: () throws -> Void) {
do {
try arg()
} catch let x as Err1 {
print(x)
} catch let x {
print(x)
}
}
func test5(_ x: Int) {
let <base>x</base> = x
print(<base>x</base>)
}
func testCaptureVariable() {
let capturedVariable = 0
_ = { [capturedVariable] in
print(capturedVariable)
}
}