[
https://issues.apache.org/jira/browse/THRIFT-339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674346#action_12674346
]
David Reiss commented on THRIFT-339:
------------------------------------
Something isn't right here. I think it has to do with resetting the
sorted_key_pos inside the inner loop.
For this structure...
{code}
struct AllPos {
2: i32 foo;
3: i32 bar;
}
{code}
I get this output...
{code}
thrift_spec = (
None, # 0
None, # 1
(2, TType.I32, 'foo', None, None, ), # 2
None, # 0
None, # 1
None, # 2
(3, TType.I32, 'bar', None, None, ), # 3
)
{code}
> THRIFT-242 is incompatible with arguments with empty key fields
> ---------------------------------------------------------------
>
> Key: THRIFT-339
> URL: https://issues.apache.org/jira/browse/THRIFT-339
> Project: Thrift
> Issue Type: Bug
> Components: Compiler (Python)
> Reporter: Jonathan Ellis
> Attachments: thrift-339-2.patch, thrift-339-3.patch,
> thrift-339-4.patch, thrift-339.patch
>
>
> Esteve's last change to how default values are stored broke stuff. Here is a
> quick example:
> {{
> service Test
> {
> bool get_slice(i32 start = -1),
> }
> }}
> generates
> {{
> class get_slice_args:
> thrift_spec = None
> def __init__(self, start=thrift_spec[-1][4],):
> self.start = start
> }}
> which is obviously invalid.
> I'm not sure how thrift_spec is supposed to be populated here so I'm unsure
> how to fix this.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.