[ https://issues.apache.org/jira/browse/THRIFT-1603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13572731#comment-13572731 ]
Jens Geyer edited comment on THRIFT-1603 at 2/6/13 7:52 PM: ------------------------------------------------------------ {quote} If the two "return false;" don't have the same meaning, won't the first one produce an incomprehensible error message? {quote} The first test checks for duplicate IDs, not names. However, I got this message which should be sufficient for both cases: {code} [ERROR:C:/D/TPCPP/Thrift/Testcase/err-num-1.thrift:6] (last token was '}') "1: field2" - field identifier/name has already been used {code} But I'm questioning the insert() even more. Can we, according to http://www.cplusplus.com/reference/algorithm/equal_range, really be sure that {code}bounds.second{code} always has the right value? Shouldn't it be better {code} members_in_id_order_.insert( elem.get_key(), elem); {code} instead? was (Author: jensg): {code} if (bounds.first != bounds.second) { return false; } // some more code members_in_id_order_.insert(bounds.second, elem); {code} {quote} won't [this comparison] produce an incomprehensible error message? {quote} This test checks for duplicate IDs, not names. I got this message: {code} [ERROR:C:/D/TPCPP/Thrift/Testcase/err-num-1.thrift:6] (last token was '}') "1: field2" - field identifier/name has already been used {code} But I'm questioning the insert() even more. Can we, according to http://www.cplusplus.com/reference/algorithm/equal_range, really be sure that {code}bounds.second{code} always has the right value? Shouldn't it be better {code} members_in_id_order_.insert( elem.get_key(), elem); {code} instead? > Thrift IDL allows for multiple exceptions, args or struct member names to be > the same > ------------------------------------------------------------------------------------- > > Key: THRIFT-1603 > URL: https://issues.apache.org/jira/browse/THRIFT-1603 > Project: Thrift > Issue Type: Bug > Environment: RedHat 5.5, C++, thrift-0.8.0 > Reporter: Michael Popovich > Assignee: Kamil Sałaś > Priority: Trivial > Fix For: 1.0 > > Attachments: > 0001-Thrift-1603-Provide-unique-names-for-t_struct-elemen.patch > > > I noticed that the Thrift IDL compiler allows for multiple exceptions > instances to utilize the same name... This is a problem because when > compiling to C++, the generated C++ code will not compile properly: > service whatever > { > void insert(1: string s) throws (1: NS nst, WX wxx, NSTx nst), > } -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira