Răsfoiți Sursa

run check_interface on interfaces which extend other interfaces too (closes #2969)

Simon Krajewski 11 ani în urmă
părinte
comite
c96fa3058a

+ 17 - 0
tests/misc/projects/Issue2969/Main.hx

@@ -0,0 +1,17 @@
+interface A {
+	public function a():String;
+}
+
+interface B extends A {
+
+}
+
+interface C extends B {
+	public function a():Int;
+}
+
+class Main {
+	static function main() {
+
+	}
+}

+ 1 - 0
tests/misc/projects/Issue2969/compile-fail.hxml

@@ -0,0 +1 @@
+--run Main

+ 5 - 1
typeload.ml

@@ -1080,7 +1080,11 @@ let set_heritance ctx c herits p =
 			process_meta csup;
 			if c.cl_interface then begin
 				if not csup.cl_interface then error "Cannot extend by using a class" p;
-				c.cl_implements <- (csup,params) :: c.cl_implements
+				c.cl_implements <- (csup,params) :: c.cl_implements;
+				if not !has_interf then begin
+					delay ctx PForce (fun() -> check_interfaces ctx c);
+					has_interf := true;
+				end
 			end else begin
 				if csup.cl_interface then error "Cannot extend by using an interface" p;
 				c.cl_super <- Some (csup,params)