Selaa lähdekoodia

improved some haxe 3 related error messages

Simon Krajewski 12 vuotta sitten
vanhempi
commit
f7a8ec51e2
2 muutettua tiedostoa jossa 10 lisäystä ja 1 poistoa
  1. 4 0
      main.ml
  2. 6 1
      typer.ml

+ 4 - 0
main.ml

@@ -80,6 +80,10 @@ let deprecated = [
 	"Class not found : Hash","Hash was moved to haxe.ds.StringMap";
 	"Class not found : IntHash","IntHash was moved to haxe.ds.IntMap";
 	"Class not found : haxe.FastList","haxe.FastList was moved to haxe.ds.GenericStack";
+	"#Std has no field format","Std.format has been removed, use single quote 'string ${escape}' syntax instead";
+	"Class not found : Int32","Int32 has been removed, use Int instead";
+	"Identifier 'EType' is not part of enum haxe.macro.ExprDef","EType has been removed, use EField instead";
+	"Identifier 'CType' is not part of enum haxe.macro.Constant","CType has been removed, use CIdent instead";
 ]
 
 let error ctx msg p =

+ 6 - 1
typer.ml

@@ -2238,7 +2238,12 @@ and type_expr ctx (e,p) (with_type:with_type) =
 		(match tp with
 		| None ->
 			let el = List.map (fun e -> type_expr ctx e Value) el in
-			let t = try unify_min_raise ctx el with Error (Unify l,p) -> raise (Error (Unify l, p))  in
+			let t = try
+				unify_min_raise ctx el
+			with Error (Unify l,p) ->
+				display_error ctx "Arrays of mixed types are only allowed if the type is forced to Array<Dynamic>" p;
+				raise (Error (Unify l, p))
+			in
 			mk (TArrayDecl el) (ctx.t.tarray t) p
 		| Some t ->
 			let el = List.map (fun e ->