瀏覽代碼

move structure with new deprecation message to typeload [skip ci]

Simon Krajewski 9 年之前
父節點
當前提交
1c3c42040d
共有 2 個文件被更改,包括 1 次插入1 次删除
  1. 1 0
      typeload.ml
  2. 0 1
      typer.ml

+ 1 - 0
typeload.ml

@@ -538,6 +538,7 @@ and load_complex_type ctx p t =
 				| None -> error ("Explicit type required for field " ^ n) p
 				| Some t -> load_complex_type ctx p t
 			in
+			if n = "new" then ctx.com.warning "Structures with new are deprecated, use haxe.Constraints.Constructible instead" p;
 			let no_expr = function
 				| None -> ()
 				| Some (_,p) -> error "Expression not allowed here" p

+ 0 - 1
typer.ml

@@ -3512,7 +3512,6 @@ and type_expr ctx (e,p) (with_type:with_type) =
 				| TAnon a ->
 					(try
 						unify ctx (PMap.find "new" a.a_fields).cf_type ct p;
-						ctx.com.warning "Structures with new are deprecated, use haxe.Constraints.Constructible instead" p;
 						true
 					with Not_found ->
 						 false)