You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Alex Medvedev (JIRA)" <ji...@apache.org> on 2015/03/09 12:31:39 UTC

[jira] [Created] (THRIFT-3034) optional/required keywords in argument lists

Alex Medvedev created THRIFT-3034:
-------------------------------------

             Summary: optional/required keywords in argument lists
                 Key: THRIFT-3034
                 URL: https://issues.apache.org/jira/browse/THRIFT-3034
             Project: Thrift
          Issue Type: Question
          Components: Compiler (General)
    Affects Versions: 0.9.2
            Reporter: Alex Medvedev


According to this commit optional/required keywords in argument lists was disallowed by thrift compiler:

{code}
commit 7816572784c7ddafc2c4350b221469af12d198fc
Author: Mark Slee <mc...@apache.org>
Date:   Mon Sep 10 22:08:49 2007 +0000

Modify Thrift parser to disallow optional/required keywords in argument lists
    
Reviewed By: dreiss
    
Test Plan: Toss an optional/required in an arg list,
check that it's ignored and compiler spits a warning
    
    
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665255 
13f79535-47bb-0310-9956-ffa450edef68
{code}

Nevertheless [Thrift IDL|https://thrift.apache.org/docs/idl] states that Field token can optionally contain optional/required keyword.

This behavior can be workarounded by usage of synthetically created struct with optional fields passed as a single argument instead of whole argument list. But this approach is not native.

The question is why this functionality was omitted and is that reasonable to implement it nowadays?

Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)