slachiewicz opened a new pull request, #3817:
URL: https://github.com/apache/thrift/pull/3817

   A service method that takes an enum declared in an included file generates a 
`-remote` stub that does not compile. The stub qualifies the enum with the 
service's own package:
   
   ```go
   argvalue1 := includestest.Numberz(tmp1)
   ```
   
   `Numberz` is declared in `ThriftTest.thrift` and generated into 
`thrifttest`, which the stub already imports.
   
   ```
   gopath/src/includestest/test_service-remote/test_service-remote.go:179:29: 
undefined: includestest.Numberz
   
gopath/src/includestest/extended_service-remote/extended_service-remote.go:197:29:
 undefined: includestest.Numberz
   ```
   
   The enum branch of `generate_service_remote` wrote `package_name_aliased` 
unconditionally. The struct branch a few lines below already resolves the 
package with `module_name()` and falls back to `package_name_aliased` only when 
that is empty; the enum branch now does the same, so a typedef of an enum in 
the local package still resolves locally.
   
   `lib/go/test` builds `includestest` but not its two `-remote` packages, 
which is why this never showed up. Both are added to the `check` list.
   
   `IncludesTest.thrift` already has the shape that reproduces it, so no new 
IDL is needed:
   
   ```thrift
   service testService extends ThriftTest.SecondService {
     ThriftTest.CrazyNesting getCrazyNesting(
       1: ThriftTest.StructA a,
       2: ThriftTest.Numberz numbers
     ) throws(1: ThriftTest.Xception err1),
   }
   ```
   
   Regenerating every IDL under `test/`, `lib/go/test/` and `tutorial/` with 
and without the change touches 2 of 325 generated files — the two stubs above, 
one line each.
   
   Independent of #3812; different code path, no shared lines.
   
   *This change was created with AI assistance.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to