paulk-asert opened a new pull request, #3371: URL: https://github.com/apache/groovy/pull/3371
A @Requires or @Ensures on a default or static interface method was woven into the method, but the check reads a $GCONTRACTS_ENABLED field that was added only to classes: every call failed with a missing property, and static compilation was refused. An interface with a concrete method now has the field, and the check reads it from the interface. A postcondition also called the old-variables method, which only a class compiled with contracts has, and which holds that class's fields. In an interface method with a body, old.name is now the entry value of a parameter or of a property of the interface, read through its getter, so lambdas, coerced maps and Java classes work however they store it. Any other name is a compile error. A name used only by a postcondition inherited from a separately compiled interface cannot be seen by the compiler; reading it throws an exception that says so. -- 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]
