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

Tianyang Hu commented on BEAM-6577:
-----------------------------------

The failures I experienced are callerXXX structs and funcMakerXXX:
https://github.com/apache/beam/blob/master/sdks/go/pkg/beam/util/shimx/generate.go#L267
https://github.com/apache/beam/blob/master/sdks/go/pkg/beam/util/shimx/generate.go#L263

So I think return types are also referred to in $x.Type.

I drafted a pull request to fix that: https://github.com/apache/beam/pull/7720. 
Please take a look and see if it's correct/appropriate. Thanks!


> The shim generator doesn't examine func return types when generating 
> necessary imports
> --------------------------------------------------------------------------------------
>
>                 Key: BEAM-6577
>                 URL: https://issues.apache.org/jira/browse/BEAM-6577
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-go
>            Reporter: Tianyang Hu
>            Assignee: Robert Burke
>            Priority: Major
>
> For the following function:
> {code:java}
> func myDoFn(s string) mypkg.MyType {...}
> {code}
> it's shim generated code doesn't import "mypkg", which leads to compilation 
> error "undefined mypkg..."
> Seems that the func parser inspects only the input params, not return params: 
> https://github.com/apache/beam/blob/master/sdks/go/pkg/beam/util/starcgenx/starcgenx.go#L293
> Should we do the same for return types?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to