Browse Source

Forbid (never, never) (#6800)

Guillaume Desquesnes 7 years ago
parent
commit
57b9da7f5b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/typing/typeload.ml

+ 1 - 1
src/typing/typeload.ml

@@ -2735,7 +2735,7 @@ module ClassInitializer = struct
 				if not cctx.is_lib then delay_check (fun() -> check_method set t_set (if set <> "set" && set <> "set_" ^ name then Some ("set_" ^ name) else None));
 				if not cctx.is_lib then delay_check (fun() -> check_method set t_set (if set <> "set" && set <> "set_" ^ name then Some ("set_" ^ name) else None));
 				AccCall
 				AccCall
 		) in
 		) in
-		if set = AccNormal && (match get with AccCall -> true | _ -> false) then error (name ^ ": Unsupported property combination") p;
+		if (set = AccNormal && get = AccCall) || (set = AccNever && get = AccNever)  then error (name ^ ": Unsupported property combination") p;
 		let cf = {
 		let cf = {
 			(mk_field name ret f.cff_pos (pos f.cff_name)) with
 			(mk_field name ret f.cff_pos (pos f.cff_name)) with
 			cf_doc = f.cff_doc;
 			cf_doc = f.cff_doc;