Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
countFieldAccess
package metaobjectTest
@doc{*
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;
}
@countFieldAccess
var String s = "0";
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.