Instantly share code, notes, and snippets.

Embed
What would you like to do?
Metaobject addBeforeMethod
package metaobjectTest
@addBeforeMethod("AddBeforeMethod", "zero", "logStr = logStr ++ \"called zero\"")
object AddBeforeMethod
func run {
assert zero == 0;
assert logStr == "called zero";
}
func zero -> Int {
return 0;
}
var String logStr = "";
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment