You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jens Geyer (Jira)" <ji...@apache.org> on 2020/02/28 08:51:00 UTC

[jira] [Resolved] (THRIFT-5124) Cannot use reserved language keyword

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

Jens Geyer resolved THRIFT-5124.
--------------------------------
    Resolution: Duplicate

There are a bunch of reserved words across all languages, and the test tells you that you hit one of them. This is not a per-language test.

Besides these, you are right and they should be escaped.

There are some other tickets in that area that wait for someone tackling them, as the general handling of these keywords for sure has potential for optimization. I fully agree on that point, there is some work to be done.

> Cannot use reserved language keyword
> ------------------------------------
>
>                 Key: THRIFT-5124
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5124
>             Project: Thrift
>          Issue Type: Bug
>          Components: Rust - Compiler
>         Environment: MacOS with thrift version 0.13
>            Reporter: Chris Holcombe
>            Priority: Major
>
> When running 
> {noformat}
> thrift --gen rs -out . sample.thrift{noformat}
> against a thrift file that contains a field with `From from` the generation fails with the error:
> {noformat}
> [FAILURE:generation:1] Cannot use reserved language keyword: "from"{noformat}
> It was my understanding that the rust library should escape all reserved words.
> An example thrift file:
> {noformat}
> struct From {
>   1: string name,
> }
> struct Sample {
>   1: From from,
> }{noformat}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)