Created
July 12, 2014 01:16
-
-
Save mike-neck/c964450b409187f5ee42 to your computer and use it in GitHub Desktop.
GroovyのRuntime implementaion of traitsを試した
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
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