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

ASF GitHub Bot commented on THRIFT-3842:
----------------------------------------

GitHub user markerickson-wf opened a pull request:

    https://github.com/apache/thrift/pull/1019

    THRIFT-3842 Fix Dart generator for const structs

    @tylertreat-wf 
    @stevenosborne-wf 
    @brianshannan-wf
    
    ref: https://issues.apache.org/jira/browse/THRIFT-3842

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/markerickson-wf/thrift thrift-3842

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/1019.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1019
    
----
commit e79da1dfb4a9860f8c27707919bd6e102678af60
Author: Mark Erickson <mark.erick...@workiva.com>
Date:   2016-05-25T18:06:00Z

    THRIFT-3842 Fix Dart generator for const structs

commit 07aa863c84366c404fdc0c7c8bca3bfb74c784d9
Author: Mark Erickson <mark.erick...@workiva.com>
Date:   2016-05-25T18:18:47Z

    Remove unnecessary call to service_imports

----


> Dart generates incorrect code for a const struct
> ------------------------------------------------
>
>                 Key: THRIFT-3842
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3842
>             Project: Thrift
>          Issue Type: Bug
>          Components: Dart - Compiler
>            Reporter: Mark Erickson
>            Assignee: Mark Erickson
>
> This snippet:
> {code}
> struct Operator {
>     1:string displayName
>     2:string fieldSuffix
> }
> const Operator equalTo = {'displayName': '=', 'fieldSuffix': 'eq'}
> const Operator notEqualTo = {'displayName': '!=', 'fieldSuffix': 'ne'}
> {code}
> Produces this Dart code:
> {code}
> ...
> static final Operator equalTo = new Operator();
> equalTo.displayName = '=';
> equalTo.fieldSuffix = 'eq';
> ...
> {code}
> But it should produce this Dart code:
> {code}
> static final Operator equalTo = new Operator()
>   ..displayName = '='
>   ..fieldSuffix = 'eq';
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to