Yes, I am all for explicitly disallowing or at least warning in this case, lol. IntelliJ has a great inspections tool to lean on in cases like these, and I believe Kotlin and IntelliJ are sufficiently married to consider this an adequate solution (correct me if this is a bad assumption.) See my proposal in the last comment to warn or fail in all cases where a “prefix” method is invoked inside a same-or-higher precedence construct. Sandwiching a colon into the construct may change things, not sure.
1 Like