瀏覽代碼

[jvm] deal with abstract no expression corner case

Simon Krajewski 2 年之前
父節點
當前提交
d45708344d
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      src/generators/genjvm.ml

+ 7 - 1
src/generators/genjvm.ml

@@ -2581,7 +2581,13 @@ class tclass_to_jvm gctx c = object(self)
 		let field mtype cf = match cf.cf_kind with
 			| Method (MethNormal | MethInline) ->
 				List.iter (fun cf ->
-					if not (has_class_field_flag cf CfExtern) then self#generate_method gctx jc c mtype cf
+					let is_weird_abstract_field_without_expression = match cf.cf_expr,c.cl_kind with
+						| None,KAbstractImpl _ ->
+							true
+						| _ ->
+							false
+					in
+					if not (has_class_field_flag cf CfExtern) && not (is_weird_abstract_field_without_expression) then self#generate_method gctx jc c mtype cf
 				) (cf :: List.filter (fun cf -> has_class_field_flag cf CfOverload) cf.cf_overloads)
 			| _ ->
 				if not (has_class_flag c CInterface) && is_physical_field cf then self#generate_field gctx jc c mtype cf