thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James E. King III (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (THRIFT-4846) C++ generator should topologically sort struct definitions and error on cycles
Date Tue, 09 Apr 2019 19:16:00 GMT

    [ https://issues.apache.org/jira/browse/THRIFT-4846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16813728#comment-16813728
] 

James E. King III commented on THRIFT-4846:
-------------------------------------------

Pull request?

> C++ generator should topologically sort struct definitions and error on cycles
> ------------------------------------------------------------------------------
>
>                 Key: THRIFT-4846
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4846
>             Project: Thrift
>          Issue Type: Bug
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Major
>         Attachments: thrift-4846.patch
>
>
> C++ (and maybe other languages?) treat Thrift struct-typed fields as plain struct members
of the containing struct. Currently, the generator outputs the types in the same order as
they're defined in the underlying Thrift field, which means that a file like:
> {code}
> struct A {
>   1: B foo;
> }
> struct B {
> }
> {code}
> will generate C++ code that fails to compile.
> We should topologically-sort the structs before outputting the definitions so that the
generated code compiles correctly.



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

Mime
View raw message