-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathlooping-givens.check
48 lines (48 loc) · 3.15 KB
/
looping-givens.check
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
-- Error: tests/neg/looping-givens.scala:9:22 --------------------------------------------------------------------------
9 | given aa: A = summon // error
| ^
| Result of implicit search for T will change.
| Current result ab will be no longer eligible
| because it is not defined before the search position.
| Result with new rules: a.
| To opt into the new rules, compile with `-source future` or use
| the `scala.language.future` language import.
|
| To fix the problem without the language import, you could try one of the following:
| - use a `given ... with` clause as the enclosing given,
| - rearrange definitions so that ab comes earlier,
| - use an explicit argument.
|
| where: T is a type variable with constraint <: A
-- Error: tests/neg/looping-givens.scala:10:22 -------------------------------------------------------------------------
10 | given bb: B = summon // error
| ^
| Result of implicit search for T will change.
| Current result ab will be no longer eligible
| because it is not defined before the search position.
| Result with new rules: b.
| To opt into the new rules, compile with `-source future` or use
| the `scala.language.future` language import.
|
| To fix the problem without the language import, you could try one of the following:
| - use a `given ... with` clause as the enclosing given,
| - rearrange definitions so that ab comes earlier,
| - use an explicit argument.
|
| where: T is a type variable with constraint <: B
-- Error: tests/neg/looping-givens.scala:11:28 -------------------------------------------------------------------------
11 | given ab: (A & B) = summon // error
| ^
| Result of implicit search for T will change.
| Current result ab will be no longer eligible
| because it is not defined before the search position.
| Result with new rules: Search Failure: joint(ab, ab).
| To opt into the new rules, compile with `-source future` or use
| the `scala.language.future` language import.
|
| To fix the problem without the language import, you could try one of the following:
| - use a `given ... with` clause as the enclosing given,
| - rearrange definitions so that ab comes earlier,
| - use an explicit argument.
|
| where: T is a type variable with constraint <: A & B