Files
swift-mirror/test/Sema/diag_ambiguous_overloads_swift4.swift
Ding Ye 4a05369b5a Improve interface of InputMatcher with some renaming and rephrasing;
split test cases into different files for different swift versions.
2018-07-11 15:26:56 +10:00

12 lines
473 B
Swift

// RUN: %target-typecheck-verify-swift -swift-version 4
//=-------------- SR-7295 --------------=/
class sr7295 {
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, Error?) -> Void' expects 2 arguments, but 1 was used in closure body}}
}
}