|
1 | | --- Error: tests/neg/i15474.scala:7:35 ---------------------------------------------------------------------------------- |
2 | | -7 | def apply(from: String): Int = from.toInt // error |
3 | | - | ^^^^ |
| 1 | +-- Error: tests/neg/i15474.scala:6:39 ---------------------------------------------------------------------------------- |
| 2 | +6 | given c: Conversion[ String, Int ] = _.toInt // error |
| 3 | + | ^ |
4 | 4 | | Warning: result of implicit search for ?{ toInt: ? } will change. |
5 | | - | Current result Test1.c will be no longer eligible |
| 5 | + | Current result Test2.c will be no longer eligible |
6 | 6 | | because it is not defined before the search position. |
7 | 7 | | Result with new rules: augmentString. |
8 | 8 | | To opt into the new rules, use the `experimental.avoidLoopingGivens` language import. |
9 | 9 | | |
10 | 10 | | To fix the problem without the language import, you could try one of the following: |
11 | | - | - rearrange definitions so that Test1.c comes earlier, |
| 11 | + | - rearrange definitions so that Test2.c comes earlier, |
12 | 12 | | - use an explicit conversion, |
13 | 13 | | - use an import to get extension method into scope. |
14 | | --- Error: tests/neg/i15474.scala:10:39 --------------------------------------------------------------------------------- |
15 | | -10 | given c: Conversion[ String, Int ] = _.toInt // error |
16 | | - | ^ |
17 | | - | Warning: result of implicit search for ?{ toInt: ? } will change. |
18 | | - | Current result Test2.c will be no longer eligible |
19 | | - | because it is not defined before the search position. |
20 | | - | Result with new rules: augmentString. |
21 | | - | To opt into the new rules, use the `experimental.avoidLoopingGivens` language import. |
22 | | - | |
23 | | - | To fix the problem without the language import, you could try one of the following: |
24 | | - | - rearrange definitions so that Test2.c comes earlier, |
25 | | - | - use an explicit conversion, |
26 | | - | - use an import to get extension method into scope. |
27 | | --- Error: tests/neg/i15474.scala:16:56 --------------------------------------------------------------------------------- |
28 | | -16 | given Ordering[Price] = summon[Ordering[BigDecimal]] // error |
| 14 | +-- Error: tests/neg/i15474.scala:12:56 --------------------------------------------------------------------------------- |
| 15 | +12 | given Ordering[Price] = summon[Ordering[BigDecimal]] // error |
29 | 16 | | ^ |
30 | 17 | | Warning: result of implicit search for Ordering[BigDecimal] will change. |
31 | 18 | | Current result Prices.Price.given_Ordering_Price will be no longer eligible |
|
0 commit comments