Created
February 6, 2013 00:00
-
-
Save back2dos/4718931 to your computer and use it in GitHub Desktop.
Flon's Law at work.
This file contains hidden or 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 A { | |
| public var i(get, null):Int; | |
| public function new() i = 0 | |
| function get_i() return i-- | |
| } | |
| class Main { | |
| static function main() | |
| switch (new A()) { | |
| case a if (a.i < 0): trace('negative'); | |
| case a if (a.i == 0): trace('zero'); | |
| case a if (a.i > 0): trace('positive'); | |
| default: trace('without sign') | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment