Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If proto file doesn't have 'package' field (that is correct case) - CastGenerateor will generate code that have no chances to compile #1

Open
nikomoravec opened this issue Jul 30, 2018 · 3 comments

Comments

@nikomoravec
Copy link
Contributor

CastGenerator.generateCast method calls outType.toString() line 106, If CppType has null namespaces - toString() method returns 'null::TypeName'

@nikomoravec nikomoravec changed the title If proto file doesn't have 'package' field (thats correct case) - CastGenerateor will generate code that have no chances to compile If proto file doesn't have 'package' field (that is correct case) - CastGenerateor will generate code that have no chances to compile Jul 30, 2018
@nikomoravec
Copy link
Contributor Author

This issue comes from ProtoProcessor initialization, line 106
this.packageNamespace = new CppNamespace(parse.packageName());
If package is empty - packageNamespace will be null

@nikomoravec
Copy link
Contributor Author

Cornerstone have strong dependency on package name. This field are private and locates in third party library called 'squareup.wire.schema'. I think we should not use tricks like reflection or unsafe for set this field to ProtoFileElement and just make package field necessarily

@RChehowski
Copy link
Contributor

Why, no, I think it’s really not that important to preserve an existing ProtoFileElement if we instead could just costruct a new one using fancy builder, replacing package name with the synthesized one or no one at all. I think this particular thing requires a bit more precise investigation. Nevertheless, I merged your changes to the master, because we don’t have a better solution now. Wish you all the best, thank you for contributing into free software.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants