thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yan Zhulanow (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (THRIFT-4521) Cocoa compiler produces invalid code for recursive structs
Date Sat, 17 Mar 2018 03:27:00 GMT

     [ https://issues.apache.org/jira/browse/THRIFT-4521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Yan Zhulanow updated THRIFT-4521:
---------------------------------
    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.}}

  was:
{{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.}}


> Cocoa compiler produces invalid code for recursive structs
> ----------------------------------------------------------
>
>                 Key: THRIFT-4521
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4521
>             Project: Thrift
>          Issue Type: Bug
>          Components: Cocoa - Compiler
>    Affects Versions: 0.11.0
>            Reporter: Yan Zhulanow
>            Priority: Major
>
> {{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.}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message