Skip to content

Commit d139dfb

Browse files
committed
.
1 parent e25b15a commit d139dfb

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

project/Build.scala

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,8 +1224,7 @@ object Build {
12241224

12251225
val scalaFiles = (dest ** "*.scala").get
12261226

1227-
// Define patches as a map from search text to replacement text
1228-
val patches = Map(
1227+
val patches = Map( // Define patches as a map from search text to replacement text
12291228
"import scala" -> "import _root_.scala",
12301229
" scala.collection." -> " _root_.scala.collection.",
12311230
"def apply(c: Char): Trie[T]" -> "def apply(c: Char): Trie[T] | Null",
@@ -1245,11 +1244,9 @@ object Build {
12451244
var processedText = "package dotty.shaded\n" + text
12461245

12471246
// Apply patches and count usage
1248-
patches.foreach { case (search, replacement) =>
1249-
if (processedText.contains(search)) {
1250-
processedText = processedText.replace(search, replacement)
1251-
patchUsageCounter(search) += 1
1252-
}
1247+
for((search, replacement) <- patches if processedText.contains(search)){
1248+
processedText = processedText.replace(search, replacement)
1249+
patchUsageCounter(search) += 1
12531250
}
12541251

12551252
IO.write(file, processedText)

repl/test/dotty/tools/repl/ReplCompilerTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class ReplCompilerTests extends ReplTest:
7878
assertEquals(1, summon[State].imports.size)
7979
run("""mutable.Map("one" -> 1)""")
8080
assertEquals(
81-
"val res0: scala.collection.mutable.Map[String, Int] = HashMap(one -> 1)",
81+
"val res0: scala.collection.mutable.Map[String, Int] = HashMap(\"one\" -> 1)",
8282
storedOutput().trim
8383
)
8484
}

0 commit comments

Comments
 (0)