thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allen George (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (THRIFT-3325) Extended services aren't subclasses in generated Cocoa
Date Sat, 29 Dec 2018 22:00:00 GMT

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

Allen George resolved THRIFT-3325.
----------------------------------
    Resolution: Won't Fix

Cocoa support is deprecated as of Thrift 0.12.0.

> Extended services aren't subclasses in generated Cocoa
> ------------------------------------------------------
>
>                 Key: THRIFT-3325
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3325
>             Project: Thrift
>          Issue Type: Bug
>          Components: Cocoa - Library
>            Reporter: Ryan Joseph
>            Priority: Critical
>
> The following interface definition:
> {noformat}
> service Parent {
>      string name();
> }
> service Child extends Parent {
>     i32 age();
> }
> {noformat}
> Produces the following generated Cocoa (truncated for readability):
> {noformat}
> @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
> {noformat}
> 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".



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

Mime
View raw message