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

Exception when generating string constant #77

Closed
gabrielittner opened this issue Nov 10, 2016 · 3 comments
Closed

Exception when generating string constant #77

gabrielittner opened this issue Nov 10, 2016 · 3 comments

Comments

@gabrielittner
Copy link
Contributor

After upgrading to 0.3.0 I'm getting this exception when running the compiler:

java.lang.UnsupportedOperationException: cannot unbox java.lang.String
        at com.squareup.javapoet.TypeName.unbox(TypeName.java:160)
        at com.microsoft.thrifty.gen.ThriftyCodeGenerator.buildConst(ThriftyCodeGenerator.java:926)
        at com.microsoft.thrifty.gen.ThriftyCodeGenerator.generateTypes(ThriftyCodeGenerator.java:231)
        at com.microsoft.thrifty.gen.ThriftyCodeGenerator.generate(ThriftyCodeGenerator.java:262)
        at com.microsoft.thrifty.gen.ThriftyCodeGenerator.generate(ThriftyCodeGenerator.java:167)
        at com.microsoft.thrifty.compiler.ThriftyCompiler.compile(ThriftyCompiler.java:217)
        at com.microsoft.thrifty.compiler.ThriftyCompiler.main(ThriftyCompiler.java:96)

This thrift file reproduces the issue

namespace java com.example.test

const string TEST = "test";
@benjamin-bader
Copy link
Collaborator

Yikes. Should be easy to fix.

@benjamin-bader
Copy link
Collaborator

Thanks for reporting this issue; I've just released 0.3.1, which fixes it.

@gabrielittner
Copy link
Contributor Author

Awesome. Thank you for the quick response.

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