Browse Source

don't require `override` for implementing abstract functions (closes #9907)

Aleksandr Kuzmenko 5 years ago
parent
commit
1eaac28c5e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/typing/typeloadCheck.ml

+ 1 - 1
src/typing/typeloadCheck.ml

@@ -183,7 +183,7 @@ let check_overriding ctx c f =
 			if (has_class_field_flag f2 CfOverload && not (has_class_field_flag f CfOverload)) then
 				display_error ctx ("Field " ^ i ^ " should be declared with overload since it was already declared as overload in superclass") p
 			else if not (has_class_field_flag f CfOverride) then begin
-				if has_class_flag c CExtern then add_class_field_flag f CfOverride
+				if has_class_flag c CExtern || has_class_field_flag f2 CfAbstract then add_class_field_flag f CfOverride
 				else display_error ctx ("Field " ^ i ^ " should be declared with 'override' since it is inherited from superclass " ^ s_type_path csup.cl_path) p
 			end else if not (has_class_field_flag f CfPublic) && (has_class_field_flag f2 CfPublic) then
 				display_error ctx ("Field " ^ i ^ " has less visibility (public/private) than superclass one") p