Skip to content

Commit

Permalink
Fix discarded non-Unit value warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszwawrzyk committed Jun 7, 2018
1 parent 9add603 commit b283e61
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ class ConsoleInterface {
} else
super.createInterpreter(interpreterSettings)

for ((id, value) <- bindNames zip bindValues)
intp.beQuietDuring(intp.bind(id, value.asInstanceOf[AnyRef].getClass.getName, value))
for ((id, value) <- bindNames zip bindValues) {
intp.beQuietDuring {
intp.bind(id, value.asInstanceOf[AnyRef].getClass.getName, value)
()
}
}

if (!initialCommands.isEmpty)
intp.interpret(initialCommands)
Expand All @@ -68,6 +72,7 @@ class ConsoleInterface {
}

loop.run(compilerSettings)
()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class FilteredReporter(
val transformedPos: Position = positionMapper(position)
val problem = InterfaceUtil.problem(category, transformedPos, message, severity)
allProblems += problem
()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class JavaProcessLoggerSpec extends UnitSpec {

errorLogger.messages shouldBe Map.empty
reporter.problems.length shouldBe 2
()
}

def logSeparateSemanticErrors(): Unit = {
Expand All @@ -56,6 +57,7 @@ class JavaProcessLoggerSpec extends UnitSpec {

errorLogger.messages shouldBe Map.empty
reporter.problems.length shouldBe 2
()
}

def logUnparsableErrors(): Unit = {
Expand All @@ -71,5 +73,6 @@ class JavaProcessLoggerSpec extends UnitSpec {
.messages(Level.Warn)(0)
.contains("javadoc: error - invalid flag: -target") shouldBe true
errorLogger.messages(Level.Warn)(1).contains("javadoc exited with exit code -1") shouldBe true
()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@ private[inc] class APIDiff {
def build(x: Array[String], y: Array[String], builder: mutable.ArrayBuilder[Patch]): Unit = {
if (x.isEmpty) {
builder += Inserted(y.mkString)
()
} else if (y.isEmpty) {
builder += Deleted(x.mkString)
()
} else if (x.length == 1 || y.length == 1) {
needlemanWunsch(x, y, builder)
} else {
Expand Down Expand Up @@ -251,6 +253,7 @@ private[inc] class APIDiff {
}
}
builder ++= alignment
()
}

}
Expand Down
1 change: 1 addition & 0 deletions zinc/src/test/scala/sbt/inc/BaseCompilerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class BaseCompilerSpec extends BridgeProviderSpecification {
val sourceFile = baseLocation.resolve(source)
val text = Files.readAllLines(sourceFile).asScala.mkString("\n")
Files.write(sourceFile, Seq(change(text)).asJava)
()
}

def dependsOnJarFrom(other: ProjectSetup): ProjectSetup = {
Expand Down

0 comments on commit b283e61

Please sign in to comment.