Created
May 30, 2013 20:18
-
-
Save jbaruch/5680824 to your computer and use it in GitHub Desktop.
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
class ThridPartyCoolApi { | |
enum Number { | |
one(1), two(2), three(3) | |
int value | |
Number(int value) { | |
this.value = value | |
} | |
int getValue() { | |
return value; | |
} | |
} | |
static int plus(Number first, Number second) { | |
first.value + second.value | |
} | |
} | |
//so far so good: | |
assert ThridPartyCoolApi.plus(ThridPartyCoolApi.Number.one, ThridPartyCoolApi.Number.two) == 3 | |
//guess what, number four also exists! | |
// I want the following to work: | |
assert ThridPartyCoolApi.plus(ThridPartyCoolApi.Number.four, ThridPartyCoolApi.Number.two) == 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment