They could contain blocks, in which case cleanup messes up some things.
@@ -606,6 +606,8 @@ module Cleanup = struct
let e2 = loop e2 in
let e3 = loop e3 in
if_or_op e e1 e2 e3;
+ | TCall({eexpr = TLocal v},_) when is_really_unbound v ->
+ e
| TBlock el ->
let el = List.map (fun e ->
let e = loop e in
@@ -0,0 +1,15 @@
+package unit.issues;
+
+class Issue5309 extends unit.Test {
+ function test() {
+ eq(25, f2b(0.1));
+ }
+ public static inline function clamp( f : Float, min = 0., max = 1. ) {
+ return f < min ? min : f > max ? max : f;
+ public static function f2b( v:Float ) : Int {
+ return Std.int(clamp(v) * 255.0);
+}