Browse Source

force Vector.fromArrayCopy to be inlined so As3 is not sad

Simon Krajewski 11 years ago
parent
commit
45d0cf10e7
3 changed files with 3 additions and 2 deletions
  1. 1 0
      std/haxe/ds/Vector.hx
  2. 1 1
      typeload.ml
  3. 1 1
      typer.ml

+ 1 - 0
std/haxe/ds/Vector.hx

@@ -173,6 +173,7 @@ abstract Vector<T>(VectorData<T>) {
 
 		If `array` is null, the result is unspecified.
 	**/
+	#if as3 @:extern #end
 	static public inline function fromArrayCopy<T>(array:Array<T>):Vector<T> {
 		// TODO: Optimize this for flash (and others?)
 		var vec = new Vector<T>(array.length);

+ 1 - 1
typeload.ml

@@ -1655,7 +1655,7 @@ let init_class ctx c p context_init herits fields =
 		let extern = Meta.has Meta.Extern f.cff_meta || c.cl_extern in
 		let is_abstract,allow_inline =
 			match c.cl_kind, f.cff_kind with
-			| KAbstractImpl _, _ -> true,ctx.g.doinline || Meta.has Meta.Impl f.cff_meta
+			| KAbstractImpl _, _ -> true,ctx.g.doinline || Meta.has Meta.Impl f.cff_meta || extern
 			|_, FFun _ -> false,ctx.g.doinline || extern
 			| _ -> false,true
 		in

+ 1 - 1
typer.ml

@@ -502,7 +502,7 @@ let unify_min ctx el =
 let is_forced_inline c cf =
 	match c with
 	| Some { cl_extern = true } -> true
-	| Some { cl_kind = KAbstractImpl _ } -> Meta.has Meta.AssignsThis cf.cf_meta
+	| Some { cl_kind = KAbstractImpl _ } -> Meta.has Meta.AssignsThis cf.cf_meta || Meta.has Meta.Extern cf.cf_meta
 	| _ when Meta.has Meta.Extern cf.cf_meta -> true
 	| _ -> false