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 2014/01/13 19:19:01 UTC

[jira] [Assigned] (THRIFT-2311) Go: invalid code generated when exception name is a go keyword

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

Jens Geyer reassigned THRIFT-2311:
----------------------------------

    Assignee: Jens Geyer

> Go: invalid code generated when exception name is a go keyword
> --------------------------------------------------------------
>
>                 Key: THRIFT-2311
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2311
>             Project: Thrift
>          Issue Type: Bug
>          Components: Go - Compiler
>         Environment: All platforms
>            Reporter: Krzysztof Godlewski
>            Assignee: Jens Geyer
>         Attachments: thrift-go.patch
>
>
> Go code generator emits invalid code when a service method is declared to throw an exception, which name is a Go keyword.
> To reproduce, create gobug.thrift:
> {code:title=gobug.thrift}
> exception FooError { }
> service Foo {
>         void bar() throws (1: FooError error)
> }
> {code}
> Run:
> {code}
> thrift -gen go gobug.thrift && (cd gen-go/gobug && go build -a)
> {code}
> This should result in the following error:
> {code}
> ./foo.go:106: result1.Error undefined (type *BarResult has no field or method Error)
> ./foo.go:107: type error is not an expression
> ./foo.go:107: cannot assign to <nil>.error
> ./foo.go:107: result1.Error undefined (type *BarResult has no field or method Error)
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)