2
0
Эх сурвалжийг харах

Merge pull request #2330 from nadako/2329_no_props_for_abstractimpl

[cs] don't generate static properties for abstract impl classes (closes #2329)
Cauê Waneck 12 жил өмнө
parent
commit
dd85f48fc3
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      gencs.ml

+ 2 - 1
gencs.ml

@@ -1870,7 +1870,8 @@ let configure gen =
     (if is_some cl.cl_constructor then gen_class_field w false cl is_final (get cl.cl_constructor));
 		if not cl.cl_interface then begin
 			List.iter (gen_class_field w true cl is_final) snonprops;
-			List.iter (gen_prop w true cl is_final) sprops
+			(* we don't want to generate properties for abstrac implementation classes, because they don't have object to work with *)
+			if (match cl.cl_kind with KAbstractImpl _ -> false | _ -> true) then List.iter (gen_prop w true cl is_final) sprops
 		end;
     List.iter (gen_class_field w false cl is_final) fnonprops;
 		List.iter (gen_prop w false cl is_final) fprops;