diff --git a/testcases/methods/Demo.hx b/testcases/methods/Demo.hx new file mode 100644 index 0000000..e37b03f --- /dev/null +++ b/testcases/methods/Demo.hx @@ -0,0 +1,26 @@ +package testcases.methods; + +class Demo { + function doSomething(cond:Bool, val:Int, text:Null):Float { + if (cond && text == null) { + return 0.0; + } + doNothing(); + trace("I'm here"); + doNothing(); + trace("yep, still here"); + doNothing(); + return switch [cond, val] { + case [true, 0]: + std.Math.random() * val; + case [true, _]: + val + val; + case [false, 10]: + Std.parseFloat(text); + case [_, _]: + std.Math.NEGATIVE_INFINITY; + } + } + + function doNothing() {} +}