@@ -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
@@ -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)