> On Nov 1, 2016, at 7:23 AM, Toni Suter via swift-evolution 
> <[email protected]> wrote:
> 
> In Swift 3, I can declare a postfix operator that starts with a ? or a !, but 
> as far as I can tell, there's no way to actually use such an operator:
> 
> I think it would probably be best to disallow postfix operators that start 
> with a question mark or an exclamation mark.
> At the moment it is possible to declare them, but not to use them. That's not 
> very user-friendly. 


This looks like a bug — the documentation and the behavior disagree.  The docs 
say:

> Although you can define custom operators that contain a question mark (?), 
> they can’t consist of a single question mark character only. Additionally, 
> although operators can contain an exclamation mark (!), postfix operators 
> cannot begin with either a question mark or an exclamation mark.

https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/doc/uid/TP40014097-CH30-ID418

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to