Browse Source

fixed issue #272

Nicolas Cannasse 14 năm trước cách đây
mục cha
commit
03fc90f198
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      typeload.ml

+ 2 - 2
typeload.ml

@@ -313,11 +313,11 @@ let check_overriding ctx c p () =
 				else if f.cf_public <> f2.cf_public then
 				else if f.cf_public <> f2.cf_public then
 					display_error ctx ("Field " ^ i ^ " has different visibility (public/private) than superclass one") p
 					display_error ctx ("Field " ^ i ^ " has different visibility (public/private) than superclass one") p
 				else (match f.cf_kind, f2.cf_kind with
 				else (match f.cf_kind, f2.cf_kind with
+				| _, Method MethInline ->
+					display_error ctx ("Field " ^ i ^ " is inlined and cannot be overridden") p
 				| a, b when a = b -> ()
 				| a, b when a = b -> ()
 				| Method MethInline, Method MethNormal ->
 				| Method MethInline, Method MethNormal ->
 					() (* allow to redefine a method as inlined *)
 					() (* allow to redefine a method as inlined *)
-				| _, Method MethInline ->
-					display_error ctx ("Field " ^ i ^ " is inlined and cannot be overridden") p
 				| _ ->
 				| _ ->
 					display_error ctx ("Field " ^ i ^ " has different property access than in superclass") p);
 					display_error ctx ("Field " ^ i ^ " has different property access than in superclass") p);
 				try
 				try