Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-2163

incorrect Delphi code generated for typedef'ed constants

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • Delphi - Compiler
    • None
    • Patch Available

    Description

      The following IDL

      typedef map<string,Bonk> MapType
      const ThriftTest.MapType MAPCONSTANT = {'hello':{}, 'goodnight':{}}
      

      creates uncompileable code at FMAPCONSTANT, because TMapType is a reference to an interface type, not the implementing class type:

      class constructor TConstants.Create;
      begin
        FMAPCONSTANT := TMapType.Create;
      end;
      

      Expected code would be

      class constructor TConstants.Create;
      begin
        FMAPCONSTANT := TThriftDictionaryImpl<string, IBonk>.Create;
        FMAPCONSTANT.Add( 'hello', TBonkImpl.Create);
        FMAPCONSTANT.Add( 'goodnight', TBonkImpl.Create);
      end;
      

      Attachments

        Activity

          People

            jensg Jens Geyer
            jensg Jens Geyer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: