__attribute__((noescape)) isn't getting imported properly for methods.

Fixes rdar://problem/19818617.

Swift SVN r25256
This commit is contained in:
Doug Gregor
2015-02-12 22:53:59 +00:00
parent 7dae65c9fd
commit f919dd5248
3 changed files with 11 additions and 8 deletions

View File

@@ -15,7 +15,13 @@ someNSString.enumerateLinesUsingBlock({ useString($0) })
dispatch_async(dispatch_get_current_queue(), /*not a block=*/()) // expected-error{{cannot invoke 'dispatch_async' with an argument list of type '(dispatch_queue_t, ())'}} expected-note {{expected an argument list of type '(dispatch_queue_t, dispatch_block_t!)'}}
func testNoEscape(@noescape f: @objc_block () -> Void ) {
func testNoEscape(@noescape f: @objc_block () -> Void, nsStr: NSString,
@noescape fStr: (String!) -> Void) {
dispatch_async(dispatch_get_current_queue(), f) // expected-error{{invalid use of non-escaping function in escaping context '@objc_block () -> Void'}}
dispatch_sync(dispatch_get_current_queue(), f) // okay: dispatch_sync is noescape
// rdar://problem/19818617
nsStr.enumerateLinesUsingBlock(fStr) // okay due to @noescape
var x: Int = nsStr.enumerateLinesUsingBlock // expected-error{{'(@noescape (String!) -> Void) -> Void' is not convertible}}
}