Browse Source

add deprecation warning for structural extension of classes (see #2771)

Simon Krajewski 11 years ago
parent
commit
f03d52c322
2 changed files with 2 additions and 1 deletions
  1. 1 1
      std/flash/_std/EReg.hx
  2. 1 0
      typeload.ml

+ 1 - 1
std/flash/_std/EReg.hx

@@ -22,7 +22,7 @@
 @:coreApi class EReg {
 @:coreApi class EReg {
 
 
 	var r : flash.utils.RegExp;
 	var r : flash.utils.RegExp;
-	var result : {> Array<String>, index : Int, input : String };
+	var result : Dynamic;
 
 
 	public function new( r : String, opt : String ) : Void {
 	public function new( r : String, opt : String ) : Void {
 		this.r = new flash.utils.RegExp(r,opt);
 		this.r = new flash.utils.RegExp(r,opt);

+ 1 - 0
typeload.ml

@@ -419,6 +419,7 @@ and load_complex_type ctx p t =
 				| TInst ({cl_kind = KTypeParameter _},_) ->
 				| TInst ({cl_kind = KTypeParameter _},_) ->
 					error "Cannot structurally extend type parameters" p
 					error "Cannot structurally extend type parameters" p
 				| TInst (c,tl) ->
 				| TInst (c,tl) ->
+					ctx.com.warning "Structurally extending classes is deprecated and will be removed" p;
 					let c2 = mk_class null_module (fst c.cl_path,"+" ^ snd c.cl_path) p in
 					let c2 = mk_class null_module (fst c.cl_path,"+" ^ snd c.cl_path) p in
 					c2.cl_private <- true;
 					c2.cl_private <- true;
 					PMap.iter (fun f _ ->
 					PMap.iter (fun f _ ->