[swift-evolution] Postfix operators that start with ? or !

Toni Suter tonisuter at me.com
Tue Nov 1 14:35:24 CDT 2016


I have filed a bug: https://bugs.swift.org/browse/SR-3104 <https://bugs.swift.org/browse/SR-3104>

> Am 01.11.2016 um 18:08 schrieb Toni Suter via swift-evolution <swift-evolution at swift.org>:
> 
> Oh, I didn't see that, thanks! I'll write a bug report. 
> 
>> Am 01.11.2016 um 17:52 schrieb Alex Martini <amartini at apple.com>:
>> 
>> 
>>> On Nov 1, 2016, at 7:23 AM, Toni Suter via swift-evolution <swift-evolution at swift.org> 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
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161101/9f7cea6e/attachment.html>


More information about the swift-evolution mailing list