Let's see who complains!
@@ -0,0 +1,17 @@
+class Main implements I {
+
+ function new() { }
+ public function test(s:String) {
+ trace(s);
+ }
+ static function main() {
+ var m:I = new Main();
+ m.test(1);
+}
+interface I {
+ function test(s:Dynamic):Void;
@@ -0,0 +1,2 @@
+-main Main
+--interp
@@ -0,0 +1,3 @@
+Main.hx:5: lines 5-7 : Field test has different type than in I
+Main.hx:5: lines 5-7 : s : String -> Void should be s : Dynamic -> Void
+Main.hx:5: lines 5-7 : String should be Dynamic
@@ -713,7 +713,7 @@ let load_type_opt ?(opt=false) ctx p t =
let valid_redefinition ctx f1 t1 f2 t2 =
let valid t1 t2 =
Type.unify t1 t2;
- if is_null t1 <> is_null t2 then raise (Unify_error [Cannot_unify (t1,t2)]);
+ if is_null t1 <> is_null t2 || ((follow t1) == t_dynamic && (follow t2) != t_dynamic) then raise (Unify_error [Cannot_unify (t1,t2)]);
in
let t1, t2 = (match f1.cf_params, f2.cf_params with
| [], [] -> t1, t2