Created
June 12, 2019 02:36
-
-
Save joseoliv/1f8b22aa24214f702521d30f652af4e4 to your computer and use it in GitHub Desktop.
countFieldAccess
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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