Skip to content

Commit 9344e51

Browse files
committed
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
1 parent 9a9834e commit 9344e51

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

tests/neg/i16820.check

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@
88
| method g in object Test must be called with () argument
99
|
1010
| longer explanation available when compiling with `-explain`
11-
-- Error: tests/neg/i16820.scala:8:14 ----------------------------------------------------------------------------------
12-
8 | val x3 = "".formatted // error
13-
| ^^^^^^^^^^^^
14-
| missing arguments for method formatted in class String
15-
-- Error: tests/neg/i16820.scala:9:40 ----------------------------------------------------------------------------------
16-
9 | val x4 = java.nio.file.Paths.get(".").toRealPath // error
11+
-- Error: tests/neg/i16820.scala:7:40 ----------------------------------------------------------------------------------
12+
7 | val x3 = java.nio.file.Paths.get(".").toRealPath // error
1713
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1814
| missing arguments for method toRealPath in trait Path
19-
-- Error: tests/neg/i16820.scala:13:14 ---------------------------------------------------------------------------------
20-
13 |def test = Foo(3) // error
15+
-- Error: tests/neg/i16820.scala:11:14 ---------------------------------------------------------------------------------
16+
11 |def test = Foo(3) // error
2117
| ^^^^^^
2218
| missing arguments for method apply in object Foo

tests/neg/i16820.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ object Test:
44

55
val x1 = f // error
66
val x2 = g // error
7-
8-
val x3 = "".formatted // error
9-
val x4 = java.nio.file.Paths.get(".").toRealPath // error
7+
val x3 = java.nio.file.Paths.get(".").toRealPath // error
108

119
// #14567
1210
case class Foo(x: Int)(xs: String*)

0 commit comments

Comments
 (0)