mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This converts the instances of the pattern for which we have a proper substitution in lit. This will make it easier to replace it appropriately with Windows equivalents.
18 lines
436 B
Swift
18 lines
436 B
Swift
func returnFifteen() -> Int {
|
|
var y = 10
|
|
func add() {
|
|
y += 5
|
|
if y > 50 {
|
|
print("bigger than 50")
|
|
} else {
|
|
print("less")
|
|
}
|
|
}
|
|
add()
|
|
return y
|
|
}
|
|
|
|
// RUN: %empty-directory(%t.result)
|
|
// RUN: %refactor -extract-function -source-filename %s -pos=5:1 -end-pos=9:6 >> %t.result/AvoidFilePrivate.swift
|
|
// RUN: diff -u %S/Outputs/extract_local/AvoidFilePrivate.swift.expected %t.result/AvoidFilePrivate.swift
|