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

Cocoa compiler produces invalid code for recursive structs

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Do
    • Affects Version/s: 0.11.0
    • Fix Version/s: 0.13.0
    • Component/s: Cocoa - Compiler
    • Labels:
      None

      Description

      Source:

      -------

      struct Node {
          1: string name;
          2: list<Node> children;
      }

      Generated code (partially, used Thrift 0.11.0):

      ------------------------------------------------

      @interface Node : NSObject <TBase, NSCoding, NSCopying>

      @property (strong, nonatomic) NSString * name;
      @property (assign, nonatomic) BOOL nameIsSet;
      - (void) unsetName;

      @property (strong, nonatomic) NSMutableArray<Node> * children;
      @property (assign, nonatomic) BOOL childrenIsSet;
      - (void) unsetChildren;

       

      As you can see, NSMutableArray<Node> is not a valid type (NSMutableArray<Node *> * was expected), and the code doesn't compile.

        Attachments

          Activity

            People

            • Assignee:
              jking3 James E. King III
              Reporter:
              yanex Yan Zhulanow
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: