Curried methods compute transitivity of `throws`/`rethrows` incorrectly

Originator:rix.rob
Number:rdar://23250591 Date Originated:25-Oct-2015 12:56 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode Version 7.1 (7B91b)
Classification:Serious Bug Reproducible:Always
 
Summary:
Using `instance.instanceMethod(arguments)` computes transitivity correctly, but using `SomeType.instanceMethod(instance)(arguments)` does not.


Steps to Reproduce:
1. This code:
func fmap<A, B>(f: A -> B, _ x: A?) -> B? {
	return Optional.map(x)(f)
}


Expected Results:
should compile without error


Actual Results:
but totally doesn’t:

boom.swift:2:9: error: call can throw, but it is not marked with 'try' and the error is not handled
        return Optional.map(x)(f)
               ^

This is bogus; `map` is marked as `rethrows` and its function argument is not marked as `throws`.


Regression:
If you change the body of the function to `return x.map(f)`, it compiles correctly.


Notes:
N/A

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!