-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Tweak java getlitch not to skip zero #18491
Conversation
03d55b0
to
d7ddd3e
Compare
I thought I was so clever to write |
d7ddd3e
to
e340c62
Compare
Huh. Are you sure it was the |
@sjrd thanks, I was so quick with the self-deprecating humor that I wasn't paying attention. Also I have to relearn printf. Is that my "learn a programming language during lunch" for today? I remembered sign extension but was hoping to clip it. That would be Come to think of it, IIRC you told me to mask it already some years ago, unless that is deja-vu. I just got brave and consulted the doc, which I'd even forgotten is at
The underlying reason for my haste was that I can't run a single test without interrupted exception (worse, the stack trace says it's reading the |
tests/run/t12290/Test.scala
Outdated
val printable = raw"\p{Print}".r | ||
|
||
def hexdump(s: String) = s.getBytes(io.Codec.UTF8.charSet) // java.nio.charset.StandardCharsets.UTF_8 | ||
.map(b => b.toInt.toHexString.takeRight(2)).mkString |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
creative...
That sounds awful. :s I'm not sure we have anyone building dotty on WSL on a regular basis. However, I do build it on standard Windows, without WSL, and it works fine. Have you tried building outside of WSL, in the standard Windows console? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good. Thank you! I only left some NIT comments for some leftover code
tests/run/t12290/Test.scala
Outdated
} | ||
|
||
val printable = raw"\p{Print}".r |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be removed
tests/run/t12290/Test.scala
Outdated
/* | ||
.map(b => b.toChar match { | ||
case c @ printable() => f"$c%2c" | ||
case _ => f"$b%02x" | ||
}).mkString | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, I think hexdump method is pretty self explanatory already
Until I return to it, the stacktrace I see on clean repo.
|
e340c62
to
5f29c21
Compare
I updated the test as it was supposed to have been written. I see |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you once again!
Backports #18491 to the LTS branch. PR submitted by the release tooling. [skip ci]
Backports #18491 to the LTS branch. PR submitted by the release tooling. [skip ci]
The "skip zero" behavior was to accommodate escaped EOL in a text block, but also skips zero-valued escaped char
\0
.This fix is less precious and uses a flag called
skip
.Scala 2 previously received the complementary fix, because it wasn't preserving the char before the escaped EOL (after backporting the dotty code):
scala/scala#10024
Vulpix doesn't work for me locally, as I just get InterruptedException, like it shuts down before my test finishes.
This seems to not crash in manual test.
The test passes under
sbt test
, so that's nice.Obligatory pun that
getlitch
is pronouncedglitch
.Fixes #18490