C# CodeGen ignores RODLStruct AutoCreateParams="1" for nested structs

Delphi XE5, RemObjects SDK for Delphi and all Clients 8.3.93.1183

RODLStruct AutoCreateParams defines “if the described object has the ability to autocreate fields”.
When AutoCreateParams is enabled:

  • Delphi CodeGen follows this rule and autocreates field in property getter.
  • C# CodeGen ignores AutoCreateParams and leaves field unassigned in property getter.

As a result we have generated classes with asymmetric behavior.
Is it a bug?

Example:

RODL file extras:

<Struct Name="AddressData" AutoCreateParams="1">
  <Elements>
    <Element Name="Country" DataType="WideString"/>
    ...
  </Elements>
</Struct>

<Struct Name="CustomerData" AutoCreateParams="1">
  <Elements>
    <Element Name="DeliveryAddress" DataType="AddressData"/>
    <Element Name="InvoiceAddress" DataType="AddressData"/>
    ... 
  </Elements>
</Struct>

Delphi CodeGen (OK):

CustomerData = class(TROComplexType)
private
function GetDeliveryAddress: AddressData;

function CustomerData.GetDeliveryAddress: AddressData;
begin
if (fDeliveryAddress = nil) then fDeliveryAddress := AddressData.Create();
Result := fDeliveryAddress;
end;

C# CodeGen (???):

class CustomerData : ComplexType {
public virtual AddressData DeliveryAddress {
get {
return @__DeliveryAddress;
}

}
}

Nice to get some feedback from support team on this issue.

Hello

Sorry for belated answer. I’ll log the appropriate issue. Still just implementing this feature would be a possibly breaking change, so it will be discussed further.

Regards

Thanks, logged as bugs://73848

Any update on this issue?

Hello

We are currently re-evaluating priority of this feature

bugs://73848 got closed with status notfixable.

Unfortunately ‘fixing’/implementing this feature can potentially break a lot of existing .NET code

All and every RODL Structure defined via Service Builder is already marked with AutoCreateParams attribute. So regenerating any _Intf .NET code can potentially change behavior of existing clients code