-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Labels
comp-codegenIssue is related to code generatorIssue is related to code generatorctg-enhancementNew feature, improvement or change requestNew feature, improvement or change request
Description
Description
Sometimes we need to render some expression with string interpolation. There is no support for it now.
It will be useful. for example, to assert failures with informative messages. Something like this
fail("Informative message with variables from generated code")
Expected behavior
In Kotlin it should be rendered like this
"An overflow error occurred in ${method.name} call with arguments ${first.name} ${first.value}, ${second.name} ${second.value}"
In Java it is a little bit complicated
String.format("An overflow error occured in %s call with arguments %s %s, %s %s", method.name, first.name, first.value, second.name, second.value)
Here we need to think about the modifiers for complex types
Potential alternatives
This examples are just a proposal, we may introduce another approach.
Context
There are not specific Cg items for this. We need to introduce them.
Metadata
Metadata
Assignees
Labels
comp-codegenIssue is related to code generatorIssue is related to code generatorctg-enhancementNew feature, improvement or change requestNew feature, improvement or change request
Type
Projects
Status
Done