From 9344e514246e9cbdf119c94a1871cc4dfc18ad19 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Mon, 20 Feb 2023 15:51:54 +0100 Subject: [PATCH] Remove usage of JDK version dependent method from neg/i16820 test. `formatted` is a deprecated Scala extension method and a function with a the same was added to String in JDK15 --- tests/neg/i16820.check | 12 ++++-------- tests/neg/i16820.scala | 4 +--- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/tests/neg/i16820.check b/tests/neg/i16820.check index 5f2e82bbf2ef..f51bfafef899 100644 --- a/tests/neg/i16820.check +++ b/tests/neg/i16820.check @@ -8,15 +8,11 @@ | method g in object Test must be called with () argument | | longer explanation available when compiling with `-explain` --- Error: tests/neg/i16820.scala:8:14 ---------------------------------------------------------------------------------- -8 | val x3 = "".formatted // error - | ^^^^^^^^^^^^ - | missing arguments for method formatted in class String --- Error: tests/neg/i16820.scala:9:40 ---------------------------------------------------------------------------------- -9 | val x4 = java.nio.file.Paths.get(".").toRealPath // error +-- Error: tests/neg/i16820.scala:7:40 ---------------------------------------------------------------------------------- +7 | val x3 = java.nio.file.Paths.get(".").toRealPath // error | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | missing arguments for method toRealPath in trait Path --- Error: tests/neg/i16820.scala:13:14 --------------------------------------------------------------------------------- -13 |def test = Foo(3) // error +-- Error: tests/neg/i16820.scala:11:14 --------------------------------------------------------------------------------- +11 |def test = Foo(3) // error | ^^^^^^ | missing arguments for method apply in object Foo diff --git a/tests/neg/i16820.scala b/tests/neg/i16820.scala index 7a93f3a5d355..abdc741b9f0e 100644 --- a/tests/neg/i16820.scala +++ b/tests/neg/i16820.scala @@ -4,9 +4,7 @@ object Test: val x1 = f // error val x2 = g // error - - val x3 = "".formatted // error - val x4 = java.nio.file.Paths.get(".").toRealPath // error + val x3 = java.nio.file.Paths.get(".").toRealPath // error // #14567 case class Foo(x: Int)(xs: String*)