Skip to content

Commit 111b8d0

Browse files
Make scalatest-overload-3.7.scala a warn test
1 parent e8b9cee commit 111b8d0

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- Warning: tests/warn/scalatest-overload-3.7.scala:22:18 --------------------------------------------------------------
2+
22 | "hello world" should endWith ("world") // warn: overloading resolution change
3+
| ^^^^^^
4+
| Overloading resolution for arguments (("hello world" : String))(EndWithWord) between alternatives
5+
| [T](leftSideValue: T)(word: EndWithWord)(using x$3: T <:< String): Unit
6+
| [T](leftSideValue: T)(word: StartWithWord)(using x$3: T <:< String): Unit
7+
| (leftSideString: String)(body: TestBody2): Unit
8+
| (leftSideString: String)(body: TestBody1): Unit
9+
| will change.
10+
| Current choice : [T](leftSideValue: T)(word: EndWithWord)(using x$3: T <:< String): Unit
11+
| New choice from Scala 3.7: none
12+
|
13+
| where: T is a type variable with constraint >: ("hello world" : String)

tests/neg/scalatest-overload-3.7.scala renamed to tests/warn/scalatest-overload-3.7.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import scala.language.`3.8`
1+
import scala.language.`3.7`
22

33
class TestBody1
44
class TestBody2
@@ -19,4 +19,4 @@ class Matchers:
1919

2020
class Test extends Matchers:
2121
def test(): Unit =
22-
"hello world" should endWith ("world") // error
22+
"hello world" should endWith ("world") // warn: overloading resolution change

0 commit comments

Comments
 (0)