Commit Graph

3 Commits

Author SHA1 Message Date
Pavel Yaskevich
66e13bcc85 [ConstraintSolver] Avoid unnecessarily increasing score when matching function types
Remove function-to-function type match score increase, which should only
happen contextually in presence of other restrictions, this used to fix
the case related to matching of arrays of functions with and w/e `throws`
as function parameters which used to be ambigious, and now handled by
collection-upcast conversion score.

Resolves: rdar://problem/35142121
2017-10-31 23:14:35 -07:00
Slava Pestov
06bd16c071 Sema: Fix another SE-0110 issue
The formal type of methods should be (Type) -> (Args...) -> (),
not Type -> (Args...) -> ().

This only matters in Swift 4 mode, where it was preventing the
newly-added test case from type checking.

Fixes <rdar://problem/31725325>.
2017-05-09 22:27:52 -07:00
Slava Pestov
8a1062dedd Sema: Try harder to preserve ParenType sugar when when performing upcasts
This fixes a case where we would allow a function conversion
in Swift 3 mode, but not in Swift 4. We were incorrectly stripping
off ParenTypes, which was OK in Swift 3, but with the implementation
of SE-0110 this resulted in a type mismatch.

Fixes <rdar://problem/31969605>.
2017-05-07 22:03:17 -07:00