Browse Source

fixed bug in current package typer

Nicolas Cannasse 17 years ago
parent
commit
d6ef03fee7
2 changed files with 2 additions and 7 deletions
  1. 1 0
      doc/CHANGES.txt
  2. 1 7
      typeload.ml

+ 1 - 0
doc/CHANGES.txt

@@ -52,6 +52,7 @@ TODO inlining : substitute class+function type parameters in order to have fully
 	added Type.createEnum
 	added Type.createEnum
 	check that local variables get correctly initialized before usage
 	check that local variables get correctly initialized before usage
 	haxe.Stack support for flash9
 	haxe.Stack support for flash9
+	fixed current package bug in inherited constructor type
 
 
 2008-04-05: 1.19
 2008-04-05: 1.19
 	fixed flash9 Array.toString
 	fixed flash9 Array.toString

+ 1 - 7
typeload.ml

@@ -706,13 +706,7 @@ let init_class ctx c p herits fields =
 					let p = c.cl_pos in
 					let p = c.cl_pos in
 					let esuper = (ECall ((EConst (Ident "super"),p),List.map (fun (n,_,_,_) -> (EConst (Ident n),p)) f.f_args),p) in
 					let esuper = (ECall ((EConst (Ident "super"),p),List.map (fun (n,_,_,_) -> (EConst (Ident n),p)) f.f_args),p) in
 					let acc = (if csuper.cl_extern && acc = [] then [APublic] else acc) in
 					let acc = (if csuper.cl_extern && acc = [] then [APublic] else acc) in
-					(* remove types that are superclass type-parameters *)
-					let replace_type = function
-						| Some (TPNormal { tpackage = []; tname = name; tparams = [] }) when List.exists (fun (param,_) -> name = param) csuper.cl_types ->
-							None
-						| t -> t
-					in
-					let fnew = { f with f_expr = esuper; f_args = List.map (fun (a,opt,t,c) -> a,opt,replace_type t,c) f.f_args } in
+					let fnew = { f with f_expr = esuper; f_args = List.map (fun (a,opt,t,def) -> a,opt,(if c.cl_extern then t else None),def) f.f_args } in
 					let _, _, cf, delayed = loop_cf (FFun ("new",None,acc,pl,fnew)) p in
 					let _, _, cf, delayed = loop_cf (FFun ("new",None,acc,pl,fnew)) p in
 					c.cl_constructor <- Some cf;
 					c.cl_constructor <- Some cf;
 					Hashtbl.add ctx.constructs c.cl_path (acc,pl,f);
 					Hashtbl.add ctx.constructs c.cl_path (acc,pl,f);