Main.hx 302 B

123456789101112131415
  1. import haxe.ds.Option;
  2. class Main {
  3. static function main() {
  4. var o = Some({b: null});
  5. switch (o) {
  6. case Some({b: b}) if (b != null):
  7. trace("Case 1: b=" + b);
  8. case Some({b: null}):
  9. trace("Case 2: b=null");
  10. case None: // Change None to _ and it works
  11. trace("Default");
  12. }
  13. }
  14. }