[SR-1338] Inconsistent "Ambiguous use of 'xxx'" error when calling an Obj-C method with 2 versions that take a block with 1 or 2 parameters respectively. #43946
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
type checker
Area → compiler: Semantic analysis
Environment
Reproduced in both Xcode 7.2.1 and XCode 7.3beta.
Additional Detail from JIRA
md5: 805267d093e69f2bdf7e5766181c2647
relates to:
Issue Description:
See https://github.com/mikelehen/swift-ambiguous-use-bug for a repro.
Basically, SwiftBug.h defines a class with two versions of a "observeEventType" method:
(void)observeEventType:(int)eventType withBlock:(void (^)(Thinger *thing))block;
(void)observeEventType:(int)eventType andPreviousSiblingKeyWithBlock:(void (^)(Thinger *thing, NSString *key))block;
I'm able to inconsistently call this method with trailing closure syntax. And very strangely, the presence of an innocuous print statement causes compilation to fail:
Can you:
Thanks!
The text was updated successfully, but these errors were encountered: