Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Won't Fix
-
None
-
None
-
None
Description
The following interface definition:
service Parent { string name(); } service Child extends Parent { i32 age(); }
Produces the following generated Cocoa (truncated for readability):
@protocol Parent <NSObject> - (NSString *) name; // throws TException @end // ... @protocol Child <NSObject> - (int32_t) age; // throws TException @end @interface ChildClient : NSObject <Child> { id <TProtocol> inProtocol; id <TProtocol> outProtocol; } - (id) initWithProtocol: (id <TProtocol>) protocol; - (id) initWithInProtocol: (id <TProtocol>) inProtocol outProtocol: (id <TProtocol>) outProtocol; @end
With these definitions, an instance of "Child" knows nothing of nor can ever have superclass method name() called on it. This completely breaks not only polymorphism, but the use of the "extends" keyword when generating Cocoa.
This could be easily resolved by simply having the "Child" class also conform to the "Parent" protocol, or more-correctly resolved by making "Child" an actual subclass of "Parent".
Attachments
Issue Links
- relates to
-
THRIFT-5160 Swift: generated processor does work for extended classes
- Open