Browse Source

fixed dynamic inheritance

Nicolas Cannasse 17 years ago
parent
commit
f784eaa5c3
3 changed files with 9 additions and 2 deletions
  1. 1 0
      doc/CHANGES.txt
  2. 7 1
      genswf9.ml
  3. 1 1
      std/flash9/Boot.hx

+ 1 - 0
doc/CHANGES.txt

@@ -27,6 +27,7 @@ TODO inlining : substitute class+function type parameters in order to have fully
 	added flash9.Lib.as
 	added flash9.Lib.as
 	prevent double Movieclip class declaration when linking flash9 lib
 	prevent double Movieclip class declaration when linking flash9 lib
 	allow numerical operations on type parameters constraint by Float
 	allow numerical operations on type parameters constraint by Float
+	genswf9 : fixed dynamic inheritance
 
 
 2008-02-23: 1.18
 2008-02-23: 1.18
 	some optimization and bugfix for as3 codegen
 	some optimization and bugfix for as3 codegen

+ 7 - 1
genswf9.ml

@@ -1513,10 +1513,16 @@ let generate_class ctx c =
 	) c.cl_fields []) in
 	) c.cl_fields []) in
 	let st_field_count = ref 0 in
 	let st_field_count = ref 0 in
 	let st_meth_count = ref 0 in
 	let st_meth_count = ref 0 in
+	let rec is_dynamic c =
+		if c.cl_dynamic <> None then true
+		else match c.cl_super with
+		| None -> false
+		| Some (c,_) -> is_dynamic c
+	in
 	{
 	{
 		hlc_name = name;
 		hlc_name = name;
 		hlc_super = (if c.cl_interface then None else Some (type_path ctx (match c.cl_super with None -> [],"Object" | Some (c,_) -> c.cl_path)));
 		hlc_super = (if c.cl_interface then None else Some (type_path ctx (match c.cl_super with None -> [],"Object" | Some (c,_) -> c.cl_path)));
-		hlc_sealed = c.cl_path <> (["flash"],"Boot") && c.cl_dynamic = None;
+		hlc_sealed = not (is_dynamic c);
 		hlc_final = false;
 		hlc_final = false;
 		hlc_interface = c.cl_interface;
 		hlc_interface = c.cl_interface;
 		hlc_namespace = None;
 		hlc_namespace = None;

+ 1 - 1
std/flash9/Boot.hx

@@ -24,7 +24,7 @@
  */
  */
 package flash;
 package flash;
 
 
-class Boot extends flash.display.MovieClip {
+class Boot extends flash.display.MovieClip, implements Dynamic {
 
 
 	#if (!flash9doc)
 	#if (!flash9doc)