[Java] Add CharacterLiteral to CompileTimeConstantExpr.getStringValue#8325
Conversation
| int paren = (12); | ||
| String string = "a string"; | ||
| int ternary = (3 < 5) ? 1 : 2; | ||
| char charLiteral = 'a'; | ||
|
|
||
| return; | ||
| } |
There was a problem hiding this comment.
Why is this file tab delimited when the rest are space delimited? 🤦
There was a problem hiding this comment.
I don't want to fix this as a part of this PR 😆 someone might want to make a sweep though, just my 10c
18b8a91 to
4f23a93
Compare
4f23a93 to
04cd0db
Compare
atorralba
left a comment
There was a problem hiding this comment.
Hey @JLLeitschuh, thanks for your contribution. This mostly LGTM, I added a couple of inline comments.
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
|
This PR is done and can be merged whenever you're comfortable doing so. 😄 |
|
This change breaks string concatenation logic for It looks like the reason why this change to |
|
Hm, sure, the concat case clearly needs fixing. Concat of string + char is nice to have though for example. @JLLeitschuh how about amending to have a separate getStringifiedValue, and use that to handle concatenation in the particular case where the resulting expression is of type String? Thus
|
To me that looks acceptable as well (if the qldoc describes that the value is converted to string), because in Java for example |
Removes CharacterLiteral from CompileTimeConstantExpr.getStringValue Resolves: - github#8325 (comment) - github#8325 (comment)
Removes CharacterLiteral from CompileTimeConstantExpr.getStringValue Resolves: - github#8325 (comment) - github#8325 (comment)
Removes CharacterLiteral from CompileTimeConstantExpr.getStringValue Resolves: - github#8325 (comment) - github#8325 (comment)
Removes CharacterLiteral from CompileTimeConstantExpr.getStringValue Resolves: - github#8325 (comment) - github#8325 (comment)
Removes CharacterLiteral from CompileTimeConstantExpr.getStringValue Resolves: - github#8325 (comment) - github#8325 (comment)
|
Thanks for the feedback! Resolved here: #8360 |
Java: Revert #8325, Add CharacterLiteral to CompileTimeConstantExpr.getStringValue
Simplifies end-user logic when looking for charater literals.