[WIP] Lowering string interpolation to calls to concat#16538
[WIP] Lowering string interpolation to calls to concat#16538abonie wants to merge 4 commits intodotnet:mainfrom
Conversation
Sanity check that lowering to concat does not break these simple cases
Initial attempt with many TODOs, also not sure whether it should be done in checking, but it seems that later we would have to again parse the string (since CheckExpressions is going from AST version of an interpolated string to a sprintf call basically)
❗ Release notes requiredCaution No release notes found for the changed paths (see table below). Please make sure to add an entry with an informative description of the change as well as link to this pull request, issue and language suggestion if applicable. Release notes for this repository are based on Keep A Changelog format. The following format is recommended for this repository:
If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request. You can open this PR in browser to add release notes: open in github.dev
|
Description
A draft PR to test on CI.
The idea is to lower string interpolation to a call to concat if interpolated string has at most 4 parts and all the parts are strings.
TODOs:
$"{0}{1}"has technically 5 parts - an empty string, first interpolated expression, an empty string, second interpolated expression and another empty stringFixes # (issue, if applicable)
Checklist
Test cases added
Performance benchmarks added in case of performance changes
Release notes entry updated: