> Or should the compiler only allow those two argument labels for unary 
> operator functions? That feels strange since it's not a restriction present 
> anywhere else, and it starts to feel like the labels have a dual purpose that 
> also falls into the realm of keywords.

A similar restriction exists on operators currently. Today, Swift does not 
allow keywords on operator parameters:

 23> prefix func !<T>(prefix value: T) {}
repl.swift:23:18: error: operator cannot have keyword arguments
prefix func !<T>(prefix value: T) {}
                 ^~~~~~~

What I'm suggesting is that, on unary operators, Swift require either the 
keyword "prefix" or "postfix" on the argument, and use that to differentiate 
between prefix and postfix operators. No other keyword would be used or 
permitted, and no keyword would be used or permitted on infix operators' 
arguments.

-- 
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to