closes #6480
@@ -517,6 +517,7 @@ let rec type_inline ctx cf f ethis params tret config p ?(self_calling_closure=f
| TLocal _
| TConst TThis (* not really, but should not be move inside a function body *)
-> raise Exit
+ | TObjectDecl _ | TArrayDecl _ -> raise Exit
| TField (_,FEnum _)
| TTypeExpr _
| TConst _ -> ()
@@ -0,0 +1,19 @@
+package unit.issues;
+
+class Issue6480 extends unit.Test {
+ function test() {
+ var o_blub = (function(f,o) {
+ return function(increment) {
+ return f(o,increment);
+ };
+ })(blub,{ counter : 0});
+ eq(1, o_blub(true));
+ eq(2, o_blub(true));
+ }
+ static function blub(o:{ counter: Int}, increment:Bool) {
+ if (increment) o.counter++;
+ else o.counter--;
+ return o.counter;
+}