瀏覽代碼

fix for super variables when no super constructor

Nicolas Cannasse 9 年之前
父節點
當前提交
6e69281ba0
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      genswf9.ml

+ 9 - 0
genswf9.ml

@@ -2017,7 +2017,16 @@ let check_constructor ctx c f =
 			error "You cannot assign some super class vars before calling super() in flash, this will reset them to default value" e.epos
 		| _ -> ()
 	in
+	(* only do so if we have a call to super() *)
+	let rec has_super e =
+		Type.iter has_super e;
+		match e.eexpr with
+		| TCall ({ eexpr = TConst TSuper },_) -> raise Exit
+		| _ -> ()
+	in
 	try
+		has_super f.tf_expr
+	with Exit -> try
 		loop f.tf_expr
 	with Exit ->
 		()