Browse Source

flip argument unification error message

closes #7732
Simon Krajewski 6 years ago
parent
commit
6ffd78c4db

+ 1 - 1
src/core/error.ml

@@ -225,7 +225,7 @@ module BetterErrors = struct
 				let s1,s2 = loop() in
 				let sl1 = fill s1 i [] 1 l in
 				let sl2 = fill s2 i [] 1 l in
-				Printf.sprintf "(%s) -> ..." (String.concat ", " sl1),Printf.sprintf "(%s) -> ..." (String.concat ", " sl2)
+				Printf.sprintf "(%s) -> ..." (String.concat ", " sl2),Printf.sprintf "(%s) -> ..." (String.concat ", " sl1)
 			| FunctionReturn ->
 				let s1,s2 = loop() in
 				Printf.sprintf "(...) -> %s" s1,Printf.sprintf "(...) -> %s" s2

+ 2 - 2
tests/misc/projects/Issue3361/compile1-fail.hxml.stderr

@@ -1,5 +1,5 @@
 Main.hx:5: lines 5-8 : Field v has different type than in I
 Main.hx:2: characters 2-29 : Interface field is defined here
 Main.hx:5: lines 5-8 : error: String should be Dynamic
-Main.hx:5: lines 5-8 :  have: (String) -> ...
-Main.hx:5: lines 5-8 :  want: (Dynamic) -> ...
+Main.hx:5: lines 5-8 :  have: (Dynamic) -> ...
+Main.hx:5: lines 5-8 :  want: (String) -> ...

+ 2 - 2
tests/misc/projects/Issue3361/compile2-fail.hxml.stderr

@@ -1,5 +1,5 @@
 Main2.hx:6: characters 2-46 : Field f has different type than in I
 Main2.hx:2: characters 2-44 : Interface field is defined here
 Main2.hx:6: characters 2-46 : error: String should be Dynamic
-Main2.hx:6: characters 2-46 :  have: (String) -> ...
-Main2.hx:6: characters 2-46 :  want: (Dynamic) -> ...
+Main2.hx:6: characters 2-46 :  have: (Dynamic) -> ...
+Main2.hx:6: characters 2-46 :  want: (String) -> ...

+ 2 - 2
tests/misc/projects/Issue4378/compile-fail.hxml.stderr

@@ -1,5 +1,5 @@
 Main.hx:5: lines 5-7 : Field test has different type than in I
 Main.hx:16: characters 2-32 : Interface field is defined here
 Main.hx:5: lines 5-7 : error: String should be Dynamic
-Main.hx:5: lines 5-7 :  have: (String) -> ...
-Main.hx:5: lines 5-7 :  want: (Dynamic) -> ...
+Main.hx:5: lines 5-7 :  have: (Dynamic) -> ...
+Main.hx:5: lines 5-7 :  want: (String) -> ...