2
0
Эх сурвалжийг харах

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

Simon Krajewski 9 жил өмнө
parent
commit
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)