|
1 | | --- [E007] Type Mismatch Error: tests/neg/i7294-a.scala:8:18 ------------------------------------------------------------ |
2 | | -8 | case x: T => x.g(10) // error // error |
3 | | - | ^^^^^^^ |
4 | | - | Found: Any |
5 | | - | Required: T |
6 | | - | |
7 | | - | where: T is a type in given instance f with bounds <: foo.Foo |
8 | | - | |
9 | | - | longer explanation available when compiling with `-explain` |
10 | | --- Error: tests/neg/i7294-a.scala:8:10 --------------------------------------------------------------------------------- |
11 | | -8 | case x: T => x.g(10) // error // error |
12 | | - | ^ |
13 | | - | Result of implicit search for scala.reflect.TypeTest[Nothing, T] will change. |
14 | | - | Current result foo.i7294-a$package.f will be no longer eligible |
15 | | - | because it is not defined before the search position. |
16 | | - | Result with new rules: No Matching Implicit. |
17 | | - | To opt into the new rules, use the `experimental.givenLoopPrevention` language import. |
18 | | - | |
19 | | - | To fix the problem without the language import, you could try one of the following: |
20 | | - | - use a `given ... with` clause as the enclosing given, |
21 | | - | - rearrange definitions so that foo.i7294-a$package.f comes earlier, |
22 | | - | - use an explicit argument. |
23 | | - | This will be an error in Scala 3.5 and later. |
24 | | - | |
25 | | - | where: T is a type in given instance f with bounds <: foo.Foo |
| 1 | +-- [E007] Type Mismatch Error: tests/neg/i7294-a.scala:10:20 ----------------------------------------------------------- |
| 2 | +10 | case x: T => x.g(10) // error // error |
| 3 | + | ^^^^^^^ |
| 4 | + | Found: Any |
| 5 | + | Required: T |
| 6 | + | |
| 7 | + | where: T is a type in given instance f with bounds <: foo.Foo |
| 8 | + | |
| 9 | + | longer explanation available when compiling with `-explain` |
| 10 | +-- Error: tests/neg/i7294-a.scala:10:12 -------------------------------------------------------------------------------- |
| 11 | +10 | case x: T => x.g(10) // error // error |
| 12 | + | ^ |
| 13 | + | Result of implicit search for scala.reflect.TypeTest[Nothing, T] will change. |
| 14 | + | Current result foo.Test.f will be no longer eligible |
| 15 | + | because it is not defined before the search position. |
| 16 | + | Result with new rules: No Matching Implicit. |
| 17 | + | To opt into the new rules, use the `experimental.givenLoopPrevention` language import. |
| 18 | + | |
| 19 | + | To fix the problem without the language import, you could try one of the following: |
| 20 | + | - use a `given ... with` clause as the enclosing given, |
| 21 | + | - rearrange definitions so that foo.Test.f comes earlier, |
| 22 | + | - use an explicit argument. |
| 23 | + | This will be an error in Scala 3.5 and later. |
| 24 | + | |
| 25 | + | where: T is a type in given instance f with bounds <: foo.Foo |
0 commit comments