http://stackoverflow.com/questions/25458548/swift-ambiguous-use-of-operator
3down votefavorite |
I have just downloaded Xcode6-beta6. I am getting compiler error "ambiguous use of operator ‘>‘" for following codes
It was working before in Xcode6-beta5. The code is from apple swift documentationhttps://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Closures.html#//apple_ref/doc/uid/TP40014097-CH11-XID_152 Any ideas?
|
||||||||||||||||
|
2 Answers
up vote4down vote |
I had the same issue also with
and
Apparently XCode can‘t correctly infer the correct type "String" for the parameters, thus creating an ambiguity on the operator. My solution has been to explicitly declare the type at least one of them which also makes the code more readable. Like in:
|
|||
add a comment |
up vote2down vote |
This seems to be a bug in the Foundation framework‘s bridging. It declares overrides of
|
||
add a comment |
Your Answer
Swift “ambiguous use of operator '>'”