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

String-to-bytes conversion results in compilation error #40

Closed
opensorceror opened this issue Dec 20, 2018 · 1 comment
Closed

String-to-bytes conversion results in compilation error #40

opensorceror opened this issue Dec 20, 2018 · 1 comment

Comments

@opensorceror
Copy link

opensorceror commented Dec 20, 2018

First of all, I'd like to thank you for this library. This makes mapping Typesafe config files to objects a breeze!

I'm noticing an issue with the string-to-bytes conversion. If I specify a large number, such as:

memory: 50G

The resulting code is generated as:

memory = if(c.hasPathOrNull("memory")) c.getBytes("memory") else 53687091200

The compiler then throws an error saying 53687091200 is outside the range of Int. If I convert this to a long (53687091200L), it works. But this adds a manual element to the code generation; I must now manually fix this every time I use tscfg regenerate the code.

@carueda
Copy link
Owner

carueda commented Dec 20, 2018

Hey @opensorceror Thanks for the bug report about the wrong literal for what should be a long. I'll fix this in due course.

Sorry, I'm less sure about the second part of your report (starting with "Moreover,..."). Would you mind entering a new ticket for that? Thx!

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

No branches or pull requests

2 participants