Skip to content

Commit 7e07fe4

Browse files
som-snytttgodzik
authored andcommitted
Improve test of string printing
1 parent 9bae656 commit 7e07fe4

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

compiler/src/scala/quoted/runtime/impl/printers/SourceCode.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package runtime.impl.printers
44
import dotty.tools.dotc.util.Chars
55

66
import scala.annotation.switch
7+
import scala.collection.mutable
78

89
import java.lang.StringBuilder
910

@@ -1504,8 +1505,8 @@ object SourceCode {
15041505
else
15051506
qSc + text + qSc
15061507

1507-
private[this] val names = collection.mutable.Map.empty[Symbol, String]
1508-
private[this] val namesIndex = collection.mutable.Map.empty[String, Int]
1508+
private val names = collection.mutable.Map.empty[Symbol, String]
1509+
private val namesIndex = collection.mutable.Map.empty[String, Int]
15091510

15101511
private def splicedName(sym: Symbol): Option[String] = {
15111512
if sym.owner.isClassDef then None

compiler/test/dotty/tools/dotc/printing/PrintingTest.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package dotty
22
package tools
33
package dotc
4+
package printing
45

56
import scala.language.unsafeNulls
67

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[[syntax trees at end of parser]] // tests/printing/untyped/strings.scala
2+
package <empty> {
3+
class C {
4+
def chars = "\b\t\n\f\r\"\'\\a\u0003"
5+
def greeting = "hello, world"
6+
}
7+
}
8+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
class C:
3+
def chars = "\b\t\n\f\r\"\'\\\u0061\u0003"
4+
def greeting = "hello, world"

0 commit comments

Comments
 (0)