瀏覽代碼

Fix setting of static variables via reflection when class has no member variables. Closes https://github.com/HaxeFoundation/hxcpp/issues/251

Hugh 10 年之前
父節點
當前提交
1b8622495d
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      gencpp.ml

+ 1 - 1
gencpp.ml

@@ -3516,7 +3516,7 @@ let has_set_member_field class_def =
 
 
 
 
 let has_set_static_field class_def =
 let has_set_static_field class_def =
-      let reflect_fields = List.filter (reflective class_def) (class_def.cl_ordered_fields) in
+      let reflect_fields = List.filter (reflective class_def) (statics_except_meta class_def) in
       let reflect_writable = List.filter (is_writable class_def) reflect_fields in
       let reflect_writable = List.filter (is_writable class_def) reflect_fields in
       List.exists variable_field reflect_writable
       List.exists variable_field reflect_writable
 ;;
 ;;