Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
package metaobjectTest
Annotation 'countFieldAccess' should be attached to a field. It
creates an Int field countFieldAccess_fieldName if the attached field
is fieldName. countFieldAccess_fieldName is the number of times
the field was accessed for reading or writing.
object CountFieldAccess
func run {
assert countFieldAccess_s == 0;
s = "1";
assert countFieldAccess_s == 1;
var String s = "0";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment