Skip to content

Commit

Permalink
Merge pull request #10748 from SethTisue/fix-jdk22
Browse files Browse the repository at this point in the history
silence some warnings in test code
  • Loading branch information
SethTisue committed Apr 10, 2024
2 parents 80ef12f + 3591236 commit 18b61a9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
3 changes: 2 additions & 1 deletion src/partest/scala/tools/partest/nest/StreamCapture.scala
Expand Up @@ -61,7 +61,8 @@ object StreamCapture {
extra.foreach { case (k, v) => modified.setProperty(k, v) }
// Trying to avoid other threads seeing the new properties object prior to the new entries
// https://github.com/scala/scala/pull/6391#issuecomment-371346171
UnsafeAccess.U.storeFence()
// (JDK 22 deprecates `storeFence`; once we drop JDK 8 we can use the VarHandles one instead)
UnsafeAccess.U.storeFence(): @annotation.nowarn("cat=deprecation")
System.setProperties(modified)
try {
action
Expand Down
Expand Up @@ -232,13 +232,14 @@ object TermConstructionProps extends QuasiquoteProperties("term construction") {
object O
implicit val liftO = Liftable[O.type] { _ => q"foo; bar" }
assertEqAst(q"f(..$O)", "f(foo, bar)")
}
}: @annotation.nowarn("cat=unused-locals")


property("scala/bug#7275 c2") = test {
object O
implicit val liftO = Liftable[O.type] { _ => q"{ foo; bar }; { baz; bax }" }
assertEqAst(q"f(...$O)", "f(foo, bar)(baz, bax)")
}
}: @annotation.nowarn("cat=unused-locals")

property("scala/bug#7275 d") = test {
val l = q"a; b" :: q"c; d" :: Nil
Expand Down
22 changes: 11 additions & 11 deletions test/tasty/test/scala/tools/tastytest/TastyTestJUnit.scala
Expand Up @@ -18,7 +18,7 @@ class TastyTestJUnit {
outDir = None,
additionalSettings = Nil,
additionalDottySettings = Nil
).eval
).eval()

@test def runPipelined(): Unit = {
assumeFalse("Disabled on Windows due to bug in jar format", isWindows)
Expand All @@ -29,7 +29,7 @@ class TastyTestJUnit {
outDirs = None,
additionalSettings = Nil,
additionalDottySettings = Nil
).eval
).eval()
}

@test def pos(): Unit = TastyTest.posSuite(
Expand All @@ -39,7 +39,7 @@ class TastyTestJUnit {
outDir = None,
additionalSettings = Nil,
additionalDottySettings = Nil
).eval
).eval()

/** false positives that should fail, but work when annotations are not read */
@test def posFalseNoAnnotations(): Unit = TastyTest.posSuite(
Expand All @@ -49,7 +49,7 @@ class TastyTestJUnit {
outDir = None,
additionalSettings = Seq("-Ytasty-no-annotations"),
additionalDottySettings = Nil
).eval
).eval()

@test def posDoctool(): Unit = TastyTest.posDocSuite(
src = "pos-doctool",
Expand All @@ -58,7 +58,7 @@ class TastyTestJUnit {
outDir = None,
additionalSettings = Nil,
additionalDottySettings = Nil
).eval
).eval()

@test def neg(): Unit = TastyTest.negSuite(
src = "neg",
Expand All @@ -67,7 +67,7 @@ class TastyTestJUnit {
outDir = None,
additionalSettings = Nil,
additionalDottySettings = Nil
).eval
).eval()

@test def negPipelined(): Unit = {
assumeFalse("Disabled on Windows due to bug in jar format", isWindows)
Expand All @@ -78,7 +78,7 @@ class TastyTestJUnit {
outDirs = None,
additionalSettings = Nil,
additionalDottySettings = Nil
).eval
).eval()
}

@test def negMoveMacros(): Unit = TastyTest.negChangePreSuite(
Expand All @@ -88,7 +88,7 @@ class TastyTestJUnit {
outDirs = None,
additionalSettings = Nil,
additionalDottySettings = Nil
).eval
).eval()

@test def negIsolated(): Unit = TastyTest.negSuiteIsolated(
src = "neg-isolated",
Expand All @@ -97,7 +97,7 @@ class TastyTestJUnit {
outDirs = None,
additionalSettings = Nil,
additionalDottySettings = Nil
).eval
).eval()

@test def negFullCircle(): Unit = TastyTest.negFullCircleSuite(
src = "neg-full-circle",
Expand All @@ -106,7 +106,7 @@ class TastyTestJUnit {
outDir = None,
additionalSettings = Nil,
additionalDottySettings = Nil
).eval
).eval()

val propSrc = "tastytest.src"
val propPkgName = "tastytest.packageName"
Expand Down Expand Up @@ -135,7 +135,7 @@ object TastyTestJUnit {
}

final implicit class TryOps(val op: Try[Unit]) extends AnyVal {
def eval: Unit = op match {
def eval(): Unit = op match {
case Failure(err) => fail(err.getMessage)
case _ => ()
}
Expand Down

0 comments on commit 18b61a9

Please sign in to comment.