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

Jens Geyer closed THRIFT-5160.
------------------------------
      Assignee: Jens Geyer
    Resolution: Won't Fix

> Swift: generated processor does work for extended classes
> ---------------------------------------------------------
>
>                 Key: THRIFT-5160
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5160
>             Project: Thrift
>          Issue Type: Bug
>          Components: Swift - Compiler
>    Affects Versions: 0.14.0
>            Reporter: Jano Svitok
>            Assignee: Jens Geyer
>            Priority: Major
>
> Let's say we have following IDL:
> {code}
> service service1 {
>  void func1()
> }
> service service2 extends service1 {
>  void func2()
> }
> {code}
> compiler generates processor for service2:
> {code:swift}
> extension service2Processor : TProcessor {
>   static let processorHandlers: ProcessorHandlerDictionary = {
>     var processorHandlers = ProcessorHandlerDictionary()
>     processorHandlers["func2"] = { sequenceID, inProtocol, outProtocol, 
> handler in
>        // ...processor for func2
>     }
>     return processorHandlers
>   }()
>   public func process(on inProtocol: TProtocol, outProtocol: TProtocol) 
> throws {
>     let (messageName, _, sequenceID) = try inProtocol.readMessageBegin()
>     if let processorHandler = 
> service2Processor.processorHandlers[messageName] {
>        // ...process the message
>     }
>     else {
>        // ...unknown message
>     }
>   }
> }
> {code}
> This processor will not process {{func1}} since it's not in 
> {{processorHandlers[]}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to