浏览代码

[cpp] Use the object type, not the function call type, when deciding if it dynamic or null access. Closes #5074

Hugh 9 年之前
父节点
当前提交
158e1f4919
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/generators/gencpp.ml

+ 4 - 4
src/generators/gencpp.ml

@@ -2097,14 +2097,14 @@ let retype_expression ctx request_type function_args expression_tree forInjectio
                let exprType = cpp_type_of member.cf_type in
                let is_objc = is_cpp_objc_type retypedObj.cpptype in
 
-               if clazzType=TCppDynamic then begin
+               if retypedObj.cpptype=TCppNull then
+                  CppNullAccess, TCppDynamic
+               else if retypedObj.cpptype=TCppDynamic then begin
                   if is_internal_member member.cf_name then
                     CppFunction( FuncInstance(retypedObj,false,member), funcReturn ), exprType
                   else
                      CppDynamicField(retypedObj, member.cf_name), TCppVariant
-               end else if clazzType=TCppNull then
-                  CppNullAccess, TCppDynamic
-               else if is_struct_access obj.etype then begin
+               end else if is_struct_access obj.etype then begin
                   match retypedObj.cppexpr with
                   | CppThis ThisReal ->
                       CppVar(VarThis(member)), exprType