Files
swift-mirror/test/Constraints/keypath_closure_conv_mismatch_generic.swift
Artem Chikin 7aed042817 Add fix on Keypath -> Function with multiple arguments type mismatch.
When simplifying a keypath constraint with a function type binding, single-parameter functions have the parameter type and the return type matched against the keypath root and value; whereas multiple-parameter functions cause an ambiguous failure (in `simplifyKeyPathConstraint`).

Resolves rdar://problem/57930643
2020-05-06 19:15:08 -07:00

10 lines
469 B
Swift

// RUN: %target-swift-frontend -typecheck -verify -primary-file %s
// rdar://problem/57930643
struct School {
var name: String
}
func test<A, B>(_: (A, B) -> Bool) {} // expected-note {{in call to function 'test'}}
test(\School.name) // expected-error {{generic parameter 'A' could not be inferred}} // expected-error {{generic parameter 'B' could not be inferred}} // expected-error {{cannot convert key path into a multi-argument function type '(A, B) -> Bool'}}