Skip to content

Commit 7f9d35f

Browse files
committed
A bit of style fixes here and there
1 parent 7accd88 commit 7f9d35f

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/dotty/tools/dotc/util/Attachment.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ object Attachment {
9191
private[Attachment] var next: Link[_] = null
9292

9393
final def pushAttachment[V](key: Key[V], value: V): Unit = {
94-
assert(!getAttachment(key).isDefined, s"duplicate attachment for key $key")
94+
assert(getAttachment(key).isEmpty, s"duplicate attachment for key $key")
9595
next = new Link(key, value, next)
9696
}
9797
}

test/dotty/partest/DPConsoleRunner.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ extends SuiteRunner(testSourcePath, fileManager, updateCheck, failed, javaCmdPat
120120
echo(statusLine(state))
121121
if (!state.isOk && isDiffy) {
122122
val differ = bold(red("% ")) + "diff "
123-
state.transcript.dropWhile(s => !(s startsWith differ)) foreach (echo(_))
123+
state.transcript.dropWhile(s => !(s startsWith differ)) foreach (echo)
124124
// state.transcript find (_ startsWith differ) foreach (echo(_)) // original
125125
}
126126
}
@@ -248,7 +248,7 @@ class DPTestRunner(testFile: File, suiteRunner: DPSuiteRunner) extends nest.Runn
248248
// so we ignore groups (tests suffixed with _1 and _2)
249249
override def groupedFiles(sources: List[File]): List[List[File]] = {
250250
val grouped = sources groupBy (_.group)
251-
val flatGroup = List(grouped.keys.toList.sorted.map({ k => grouped(k) sortBy (_.getName) }).flatten)
251+
val flatGroup = List(grouped.keys.toList.sorted.flatMap { k => grouped(k) sortBy (_.getName) })
252252
try { // try/catch because of bug in partest that throws exception
253253
if (flatGroup != super.groupedFiles(sources))
254254
throw new java.lang.UnsupportedOperationException()

test/test/ContextEscapeDetector.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package test;
22

3-
import org.junit.runner.Description;
43
import org.junit.runner.Result;
54
import org.junit.runner.notification.RunListener;
65
import org.junit.Assert;

0 commit comments

Comments
 (0)