Closed laglangyue closed 2 months ago
huh, I could've sworn this syntax was allowed in Scala, but indeed I don't see it in https://scala-lang.org/files/archive/spec/2.13/01-lexical-syntax.html#string-literals
@raboof Here is a timeline: I started to discover the problem, and I thought it was a problem with scalafmt, but members of scalafmt thought it was an abandoned unicode, which is actually very rare. This symbol has a universal unicode Then I submitted a PR. Finally, I argued with scalafmt that they are compatible with this Unicode form and will not throw exceptions
Both writing methods are okay in Scala, and grpc-java uses (char) "xxx"
. This pr will not affect the our test.
here is issue
https://github.com/scalameta/scalameta/issues/3690
Because this issue occurs after this PR, So I didn't give any feedback on what happened afterwards to the Pekko community
both writing methods are okay in Scala
I agree the compiler currently appears to supports it, but I don't see anything in the language specification that says it must - so perhaps it would be best not to make assumptions? Or did I miss the part of the specification that covers this case?
Thanks for bringing the issue up there and adding the reference here!
motivation
can't execute sbt scalafmtAll
according to test in grpc-java, we should use 0xD801.toChar https://github.com/grpc/grpc-java/blob/79e75bace40cea7e4be72e7dcd1f41c3ad6ee857/api/src/test/java/io/grpc/StatusTest.java#L82-L92