Last active
April 23, 2021 14:23
-
-
Save joseoliv/5d5d96f062e62db35ee6182f337e58fd to your computer and use it in GitHub Desktop.
Metaobject addBeforeMethod
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 | |
@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