paulk-asert commented on PR #3012: URL: https://github.com/apache/groovy/pull/3012#issuecomment-6390973276
Thanks Daniel. 1. There's no warning/error split between operators and named calls: s.add(v) on a parameter reports "@Pure warning: call to 's.add()' — purity cannot be verified" just as s << v reports "'<<' on 's' calls leftShift() — purity cannot be verified", and both go through the same addStaticTypeError. The difference is for locals: operators on a local value are deliberately not reported, while a named call such as out.add(x) on a local still is (unchanged by this PR). Aligning named calls with the operator rule would accept code that's refused today, so I'll leave that for a separate change. 2. Yes, that's the known limit: isNonLocalReceiver looks at the receiver variable itself, so an alias isn't followed. 3. Confirmed: the effect branches return true and the final expression is isBuiltinImmutable, so only immutable types short-circuit. 4. Agreed, << is the only common mutating non-assignment operator. 5. #3011 is merged; this PR merges cleanly on top and PurityCheckerTest passes on the result. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
