-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the new behavior dependent on source >= 3.4
- Loading branch information
Showing
7 changed files
with
122 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,38 @@ | ||
-- Error: tests/neg/i15474.scala:7:35 ---------------------------------------------------------------------------------- | ||
7 | def apply(from: String): Int = from.toInt // error | ||
| ^^^^ | ||
| Warning: result of implicit search for ?{ toInt: ? } will change. | ||
| Current result Test1.c will be no longer eligible | ||
| because it is not defined before the search position. | ||
| Result with new rules: augmentString. | ||
| To opt into the new rules, use the `experimental.avoidLoopingGivens` language import. | ||
| | ||
| To fix the problem without the language import, you could try one of the following: | ||
| - rearrange definitions so that Test1.c comes earlier, | ||
| - use an explicit conversion, | ||
| - use an import to get extension method into scope. | ||
-- Error: tests/neg/i15474.scala:10:39 --------------------------------------------------------------------------------- | ||
10 | given c: Conversion[ String, Int ] = _.toInt // error | ||
| ^ | ||
| Warning: result of implicit search for ?{ toInt: ? } will change. | ||
| Current result Test2.c will be no longer eligible | ||
| because it is not defined before the search position. | ||
| Result with new rules: augmentString. | ||
| To opt into the new rules, use the `experimental.avoidLoopingGivens` language import. | ||
| | ||
| To fix the problem without the language import, you could try one of the following: | ||
| - rearrange definitions so that Test2.c comes earlier, | ||
| - use an explicit conversion, | ||
| - use an import to get extension method into scope. | ||
-- Error: tests/neg/i15474.scala:16:56 --------------------------------------------------------------------------------- | ||
16 | given Ordering[Price] = summon[Ordering[BigDecimal]] // error | ||
| ^ | ||
| Warning: result of implicit search for Ordering[BigDecimal] will change. | ||
| Current result Prices.Price.given_Ordering_Price will be no longer eligible | ||
| because it is not defined before the search position. | ||
| Result with new rules: scala.math.Ordering.BigDecimal. | ||
| To opt into the new rules, use the `avoidLoopingGivens` language import, | ||
| Warning: result of implicit search for Ordering[BigDecimal] will change. | ||
| Current result Prices.Price.given_Ordering_Price will be no longer eligible | ||
| because it is not defined before the search position. | ||
| Result with new rules: scala.math.Ordering.BigDecimal. | ||
| To opt into the new rules, use the `experimental.avoidLoopingGivens` language import. | ||
| | ||
| To fix the problem you could try one of the following: | ||
| - rearrange definitions, | ||
| - use an explicit argument. | ||
| To fix the problem without the language import, you could try one of the following: | ||
| - rearrange definitions so that Prices.Price.given_Ordering_Price comes earlier, | ||
| - use an explicit argument. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
-- Error: tests/neg/i6716.scala:12:39 ---------------------------------------------------------------------------------- | ||
12 | given Monad[Bar] = summon[Monad[Foo]] // error | ||
| ^ | ||
| Warning: result of implicit search for Monad[Foo] will change. | ||
| Current result Bar.given_Monad_Bar will be no longer eligible | ||
| because it is not defined before the search position. | ||
| Result with new rules: Foo.given_Monad_Foo. | ||
| To opt into the new rules, use the `avoidLoopingGivens` language import, | ||
| Warning: result of implicit search for Monad[Foo] will change. | ||
| Current result Bar.given_Monad_Bar will be no longer eligible | ||
| because it is not defined before the search position. | ||
| Result with new rules: Foo.given_Monad_Foo. | ||
| To opt into the new rules, use the `experimental.avoidLoopingGivens` language import. | ||
| | ||
| To fix the problem you could try one of the following: | ||
| - rearrange definitions, | ||
| - use an explicit argument. | ||
| To fix the problem without the language import, you could try one of the following: | ||
| - rearrange definitions so that Bar.given_Monad_Bar comes earlier, | ||
| - use an explicit argument. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class A | ||
class B | ||
|
||
given joint(using a: A, b: B): (A & B) = ??? | ||
|
||
def foo(using a: A, b: B) = | ||
given aa: A = summon // error | ||
given bb: B = summon // error | ||
given ab: (A & B) = summon // error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import language.experimental.avoidLoopingGivens | ||
|
||
class A | ||
class B | ||
|
||
given joint(using a: A, b: B): (A & B) = ??? | ||
|
||
def foo(using a: A, b: B) = | ||
given aa: A = summon // error | ||
given bb: B = summon // error | ||
given ab: (A & B) = summon // error |