blob: 388119abb9783615724294313aaf42fbf8bf4cc7 [file] [log] [blame]
// RUN: %target-swift-frontend -typecheck %s -swift-version 3
// RUN: %target-swift-frontend -typecheck -update-code -primary-file %s -emit-migrated-file-path %t.result -disable-migrator-fixits -swift-version 3
// RUN: diff -u %s.expected %t.result
// RUN: %target-swift-frontend -typecheck %s.expected -swift-version 4
func test1(_: ()) {}
test1(())
test1(())
func test2() {}
test2()
enum Result<T> {
case success(T)
}
func test3(_: Result<()>) {}
test3(.success(()))
func test4(_: (Int, Int) -> ()) {}
test4({ (x,y) in })
func test5(_: (Int, Int, Int) -> ()) {}
test5({ (x,y,z) in })
func test6(_: ((Int, Int)) -> ()) {}
test6({ let (x,y) = $0; })
func test7(_: ((Int, Int, Int)) -> ()) {}
test7({ let (x,y,z) = $0; })
test6({ let (x, y) = $0; })
test6({ let (_, _) = $0; })
test6({ (__val:(Int, Int)) in let (x,y) = __val; })
test6({ (__val:(Int, Int)) ->() in let (_,_) = __val; })
func toString(indexes: Int?...) -> String {
let _ = indexes.enumerated().flatMap({ (__val:(Int, Int?)) -> String? in let (i,index) = __val;
let _: Int = i
if index != nil {}
return ""
})
}