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/05/19 23:01:00 UTC

[jira] [Commented] (THRIFT-5138) Swift generator does not escape keywords properly

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

Jens Geyer commented on THRIFT-5138:
------------------------------------

{quote}
kewords_(lang_keywords()) initialization in t_generator.h does not work. Virtual method call from base class constructor
{quote}

I wonder why we need to place this in the CTORs at all.
 Wouldn't init_generator() be the more natural (and less error prone) way ?

> Swift generator does not escape keywords properly
> -------------------------------------------------
>
>                 Key: THRIFT-5138
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5138
>             Project: Thrift
>          Issue Type: Bug
>          Components: Swift - Compiler
>    Affects Versions: 0.14.0
>            Reporter: Jano Svitok
>            Assignee: Jano Svitok
>            Priority: Major
>              Labels: breaking_change
>             Fix For: 0.14.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 1. For field `protocol` in a struct:
> *generated:*
> {code:swift}
>     try proto.validateValue(protocol, named: "protocol")
> {code}
> *expected:*
> {code:swift}
>     try proto.validateValue(`protocol`, named: "protocol")
> {code}
> 2. Swift allows any keyword to be used as identifier if you escape it, so lang_keywords() should return empty set.
> Adjust keyword test appropriately.
> 3. kewords_(lang_keywords()) initialization in t_generator.h does not work. Virtual method call from base class constructor. This mechanism is used for Python and Swift. Fixing this issue changes list of reserved words for Python and Swift (breaking change).
> https://github.com/apache/thrift/pull/2059



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