Skip to content

Commit 18b61a9

Browse files
authored
Merge pull request #10748 from SethTisue/fix-jdk22
silence some warnings in test code
2 parents 80ef12f + 3591236 commit 18b61a9

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

src/partest/scala/tools/partest/nest/StreamCapture.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ object StreamCapture {
6161
extra.foreach { case (k, v) => modified.setProperty(k, v) }
6262
// Trying to avoid other threads seeing the new properties object prior to the new entries
6363
// https://github.com/scala/scala/pull/6391#issuecomment-371346171
64-
UnsafeAccess.U.storeFence()
64+
// (JDK 22 deprecates `storeFence`; once we drop JDK 8 we can use the VarHandles one instead)
65+
UnsafeAccess.U.storeFence(): @annotation.nowarn("cat=deprecation")
6566
System.setProperties(modified)
6667
try {
6768
action

test/scalacheck/scala/reflect/quasiquotes/TermConstructionProps.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,14 @@ object TermConstructionProps extends QuasiquoteProperties("term construction") {
232232
object O
233233
implicit val liftO = Liftable[O.type] { _ => q"foo; bar" }
234234
assertEqAst(q"f(..$O)", "f(foo, bar)")
235-
}
235+
}: @annotation.nowarn("cat=unused-locals")
236+
236237

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

243244
property("scala/bug#7275 d") = test {
244245
val l = q"a; b" :: q"c; d" :: Nil

test/tasty/test/scala/tools/tastytest/TastyTestJUnit.scala

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class TastyTestJUnit {
1818
outDir = None,
1919
additionalSettings = Nil,
2020
additionalDottySettings = Nil
21-
).eval
21+
).eval()
2222

2323
@test def runPipelined(): Unit = {
2424
assumeFalse("Disabled on Windows due to bug in jar format", isWindows)
@@ -29,7 +29,7 @@ class TastyTestJUnit {
2929
outDirs = None,
3030
additionalSettings = Nil,
3131
additionalDottySettings = Nil
32-
).eval
32+
).eval()
3333
}
3434

3535
@test def pos(): Unit = TastyTest.posSuite(
@@ -39,7 +39,7 @@ class TastyTestJUnit {
3939
outDir = None,
4040
additionalSettings = Nil,
4141
additionalDottySettings = Nil
42-
).eval
42+
).eval()
4343

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

5454
@test def posDoctool(): Unit = TastyTest.posDocSuite(
5555
src = "pos-doctool",
@@ -58,7 +58,7 @@ class TastyTestJUnit {
5858
outDir = None,
5959
additionalSettings = Nil,
6060
additionalDottySettings = Nil
61-
).eval
61+
).eval()
6262

6363
@test def neg(): Unit = TastyTest.negSuite(
6464
src = "neg",
@@ -67,7 +67,7 @@ class TastyTestJUnit {
6767
outDir = None,
6868
additionalSettings = Nil,
6969
additionalDottySettings = Nil
70-
).eval
70+
).eval()
7171

7272
@test def negPipelined(): Unit = {
7373
assumeFalse("Disabled on Windows due to bug in jar format", isWindows)
@@ -78,7 +78,7 @@ class TastyTestJUnit {
7878
outDirs = None,
7979
additionalSettings = Nil,
8080
additionalDottySettings = Nil
81-
).eval
81+
).eval()
8282
}
8383

8484
@test def negMoveMacros(): Unit = TastyTest.negChangePreSuite(
@@ -88,7 +88,7 @@ class TastyTestJUnit {
8888
outDirs = None,
8989
additionalSettings = Nil,
9090
additionalDottySettings = Nil
91-
).eval
91+
).eval()
9292

9393
@test def negIsolated(): Unit = TastyTest.negSuiteIsolated(
9494
src = "neg-isolated",
@@ -97,7 +97,7 @@ class TastyTestJUnit {
9797
outDirs = None,
9898
additionalSettings = Nil,
9999
additionalDottySettings = Nil
100-
).eval
100+
).eval()
101101

102102
@test def negFullCircle(): Unit = TastyTest.negFullCircleSuite(
103103
src = "neg-full-circle",
@@ -106,7 +106,7 @@ class TastyTestJUnit {
106106
outDir = None,
107107
additionalSettings = Nil,
108108
additionalDottySettings = Nil
109-
).eval
109+
).eval()
110110

111111
val propSrc = "tastytest.src"
112112
val propPkgName = "tastytest.packageName"
@@ -135,7 +135,7 @@ object TastyTestJUnit {
135135
}
136136

137137
final implicit class TryOps(val op: Try[Unit]) extends AnyVal {
138-
def eval: Unit = op match {
138+
def eval(): Unit = op match {
139139
case Failure(err) => fail(err.getMessage)
140140
case _ => ()
141141
}

0 commit comments

Comments
 (0)