Skip to content

Instantly share code, notes, and snippets.

@mike-neck
Created July 12, 2014 01:16
Show Gist options
  • Save mike-neck/c964450b409187f5ee42 to your computer and use it in GitHub Desktop.
Save mike-neck/c964450b409187f5ee42 to your computer and use it in GitHub Desktop.
GroovyのRuntime implementaion of traitsを試した
trait One {
int one () {1}
}
trait Two {
int two () {2}
}
class Num implements One {}
def num = new Num() as Two
assert num.one() == 1
assert num.two() == 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment