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

Jens Geyer resolved THRIFT-2311.
--------------------------------

    Resolution: Fixed

+1 and committed, thanks Krzysztof!

> 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
>              Labels: reserved-word
>             Fix For: 0.9.2
>
>         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)

Reply via email to