Files
swift-mirror/test/Constraints/rdar45242032.swift
Pavel Yaskevich efd2069f0c [CSDiag] Don't increase candidate curry level if base is ignored
When `CandidateCalleeInfo` tries to create a candidate for expression
in form of `<base>.<func>` it shouldn't assume that function type of
'<func>' would always be at curry level 1, because base could be ignored
when it is a module or 'b' refers to a static function.

Resolves: rdar://problem/45242032
2018-10-17 17:47:42 -07:00

23 lines
599 B
Swift

// RUN: %target-typecheck-verify-swift -module-name M
protocol P {
var v: String { get }
}
func foo(bar: [P], baz: [P]) {
// expected-note@-1 {{'foo(bar:baz:)' declared here}}
}
struct S {
static func bar(fiz: [P], baz: [P]) {}
// expected-note@-1 {{'bar(fiz:baz:)' declared here}}
}
do {
let _ = M.foo(bar & // expected-error {{missing argument for parameter 'bar' in call}}
} // expected-error {{expected expression after operator}}
do {
let _ = S.bar(fiz & // expected-error {{missing argument for parameter 'fiz' in call}}
} // expected-error {{expected expression after operator}}