Repository navigation
THRIFT-6529: Include the service name in the Haxe argument and result struct names - #4133
Merged
Merged
Conversation
… struct names Client: haxe The Haxe generator named the argument and result structs of a method after the method alone, as classes of the package. Two services of one package with a method of the same name thus wrote the same classes, and the one written last won: the generated code did not compile, or one service used the structs of the other. The names now start with the name of the service that declares the method, as in the C++, JavaScript and PHP generators: A_get_args and A_get_result instead of Get_args and Get_result. This renames these classes, and their files, for every service. The struct descriptor and toString of an argument struct now carry the class name, as those of a result struct already did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
THRIFT-6529
The Haxe generator named the argument and result structs of a method after the method alone, as classes of the package. Two services of one namespace with a method of the same name thus wrote the same classes, and the one written last won. The names now start with the name of the service that declares the method, as in the C++, JavaScript and PHP generators:
A_get_argsandA_get_resultinstead ofGet_argsandGet_result.This renames these classes and their files for every service. The struct descriptor and
toString()of an argument struct now carry the class name, as those of a result struct already did. Otherwise the generated code stays the same.This is what turns
lib-haxe-codegenred on #4065: its netstd fixtureIsolatedNames.thrifthas methods of the same names in three services, with and without arguments.Tested on today's master:
compiler/cpp/tests/haxe/t_haxe_generator_service_tests.ccfails without the change and passes with it; all other compiler tests pass either way.lib/haxe/codegen/run-Haxe-Codegen-Tests.ps1with Haxe 4.3.6 and a two-service IDL as an extra file: without the change, it stops at that file withGet_args has no field a; with it, it ends withSuccess (252 tests executed). On master merged with THRIFT-5830: Add per-call transport isolation for netstd clients #4065, it ends withSuccess (254 tests executed).lib-haxe-codegenjob pass: the unit tests on neko, and the js TSocket test under Node.lib/go/test/NamesTest.thrift,test/AnnotationTest.thrift(fooandFoo, apart from the descriptor name) andtest/Service.thriftwith its include.🤖 Generated with Claude Code