Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-55257

IDL generates non-compiling comparison operations with inline_chained_structs:true

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: IDL
    • Service Arch
    • ALL
    • 4

      It appears that specifying {inline_chained_structs: true} leads the generated comparison operators to attempt to directly compare the member variables which exist on the chained struct despite them being on a different type.

      structs: 
          One: 
              description: ""
              generate_comparison_operators: true
              fields: 
                  one: int
      
          Two: 
              description: ""
              inline_chained_structs: true
              chained_structs: 
                  One: OneStruct
              generate_comparison_operators: true
              fields: 
                  two: int
      
      class Two {
      public:
      ...
          friend bool operator==(const Two& left, const Two& right) {
              return left._oneStruct == right._oneStruct && left._one == right._one && left._two == right._two;
          }
      ...
      private:
          mongo::One _oneStruct;
          std::int32_t _two;
          bool _hasTwo : 1;
      };
      

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: