On the off chance that this is not an April’s Fool Joke:
While the version with the KeyPath might be interesting (more on that later) the bare version presented in the original comment is just not going achieve its stated goal.
When reading code, operator precedence is baked-in in our collective mind. We know, and every language behave this way, that the unary not is at the beginning of the expression. If the expression is too long or complex, then use a variable, or == false if you really want the negation to be at the end of the expression, as already suggested.
Even though they shouldn’t both compile for the same expression, .! and !. will be so close visually that this will make easy-to-miss errors or at least create confusion. It’s only a matter of time until we will end up with ?.! and !.! in the code, and I feel that closing the gap with APL syntax is a non goal for Swift.
a .! somewhere in the middle or end of a long chain will be very easily missed. I don’t think it will increase the readability. In fact, I think it will do the exact opposite.
Regarding #expect(false&.map(!)) // ✅, I think this points towards something broader in Swift, which is the missing Scope Functions that Kotlin has (Scope functions | Kotlin Documentation), in particular, let and apply. Whatever the name is, (I’m not a big fan of map for non-list containers, but this is a completely separate discussion).
Finally regarding the KeyPath approach: If we start including operators in KeyPath, should we include the Optional ! as well, or any of the other unary operators? I’m not sure this is something we want to encourage.
A simple computed var not or toggled in an extension Bool will enable all the use cases in this thread, with a much better readability (to my eyes) than an operator somewhere in the middle of the property chain.
In conclusion, I don’t feel lile this will add much to the language and workarounds are already available.