Main.hx 473 B

123456789101112131415161718
  1. import haxe.ds.Option;
  2. class Main {
  3. static function main(){
  4. function foo():Bool { return true; }
  5. map(function(num:Int):Void {
  6. if(foo()) 10; //VerifyError: Error #1030: Stack depth is unbalanced. 2 != 1.
  7. //if(true) 10; //works
  8. });
  9. }
  10. inline //removing inline fixes.
  11. public static function map<T,K>(f:T->K):Void {
  12. switch (None) {
  13. case Some(t): Some(f(t));
  14. case None: None;
  15. }
  16. }
  17. }