Main.hx 408 B

123456789101112131415161718192021222324252627282930
  1. enum E {
  2. A;
  3. B;
  4. }
  5. class Main {
  6. static var n:Int = 3;
  7. static var e:Null<E> = A;
  8. static function main() {
  9. switch (e) {
  10. case A:
  11. // commenting this trace makes it work...
  12. trace("hi");
  13. for (i in 0...n) {
  14. trace(i);
  15. }
  16. case B:
  17. for (i in 0...n) {
  18. trace(i);
  19. }
  20. // commenting this default removes the nullcheck for `e`
  21. // and makes it work...
  22. default:
  23. }
  24. }
  25. }