Conversation
98a80fa to
9f19b05
Compare
|
It would be nice to add at least a few tests. I've not found them here (https://github.com/scala/scala3/tree/main/compiler/test/dotty/tools/dotc/printing) |
|
I would do something about the code duplication before undrafting. Everything breaks if strings are broken, and on scala 2 it was also a zinc dependency. A useful test would be a scalacheck, as there are many boundary conditions. An existing test broke because it noticed whether Unicode escapes were lowercase. (I did not argue with the test.) |
9f19b05 to
e0c617f
Compare
noti0na1
left a comment
There was a problem hiding this comment.
Sorry for so long to back to this PR. Other than the code duplication, the changes look good to me.
605e569 to
f419085
Compare
|
Inlined |
noti0na1
left a comment
There was a problem hiding this comment.
Let's merge after CI becomes green!
f419085 to
16984be
Compare
|
rebased |
Ports scala/scala#10897
It's a port of a Scala 2 support ticket, which means it is a performance improvement worth paying for. The code is not shared with Scala 2 but is similar in principle.
The bottleneck is
string.flatMap(escapedChar). At the urging of the reviewer, reduced code duplication betweenPlainPrinterandSourceCodeby sticking it inutil.Chars.