Files
swift-mirror/test/Sema/diag_ambiguous_overloads_swift4.swift
2022-09-02 11:00:19 +03:00

12 lines
484 B
Swift

// RUN: %target-typecheck-verify-swift -swift-version 4
// https://github.com/apple/swift/issues/49843
class C_49843 {
func doSomething(a: (() -> Void)? = nil, completion: @escaping ((String, Error?) -> Void)) {}
func doSomething(b: @escaping ((String, Error?, Bool) -> Void)) {}
func a() {
doSomething(a: nil, completion: { _ in })
// expected-error@-1 {{contextual closure type '(String, (any Error)?) -> Void' expects 2 arguments, but 1 was used in closure body}}
}
}