瀏覽代碼

don't allow to override method marked as @:final (close #2061)

Nicolas Cannasse 10 年之前
父節點
當前提交
dddc76b36f
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      typeload.ml

+ 1 - 0
typeload.ml

@@ -861,6 +861,7 @@ let check_overriding ctx c =
 					() (* allow to redefine a method as inlined *)
 				| _ ->
 					display_error ctx ("Field " ^ i ^ " has different property access than in superclass") p);
+				if has_meta Meta.Final f2.cf_meta then display_error ctx ("Cannot override @:final method " ^ i) p;
 				try
 					let t = apply_params csup.cl_params params t in
 					valid_redefinition ctx f f.cf_type f2 t