Skip to content

Commit ea2fe4b

Browse files
committed
Split missing-implicit test in two
The test started to become flakey since we reduced the timeout from 10 to 8 seconds and made it a global timeout.
1 parent e919d98 commit ea2fe4b

File tree

4 files changed

+49
-50
lines changed

4 files changed

+49
-50
lines changed

tests/neg/missing-implicit1.check

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,3 @@
4747
28 | Array(1, 2, 3).first // error, no hint
4848
| ^^^^^^^^^^^^^^^^^^^^
4949
| value first is not a member of Array[Int]
50-
-- Error: tests/neg/missing-implicit1.scala:44:4 -----------------------------------------------------------------------
51-
44 | ff // error
52-
| ^
53-
| no implicit argument of type Zip[Option] was found for parameter xs of method ff
54-
|
55-
| The following import might fix the problem:
56-
|
57-
| import instances.zipOption
58-
|
59-
-- [E008] Not Found Error: tests/neg/missing-implicit1.scala:46:16 -----------------------------------------------------
60-
46 | List(1, 2, 3).traverse(x => Option(x)) // error
61-
| ^^^^^^^^^^^^^^^^^^^^^^
62-
| value traverse is not a member of List[Int], but could be made available as an extension method.
63-
|
64-
| The following import might make progress towards fixing the problem:
65-
|
66-
| import instances.traverseList
67-
|
68-
-- Error: tests/neg/missing-implicit1.scala:50:42 ----------------------------------------------------------------------
69-
50 | List(1, 2, 3).traverse(x => Option(x)) // error
70-
| ^
71-
|no implicit argument of type Zip[Option] was found for an implicit parameter of method traverse in trait Traverse
72-
|
73-
|The following import might fix the problem:
74-
|
75-
| import instances.zipOption
76-
|

tests/neg/missing-implicit1.scala

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,3 @@ object testObjectInstance:
2727
List(1, 2, 3).second // error
2828
Array(1, 2, 3).first // error, no hint
2929
end testObjectInstance
30-
31-
def testLocalInstance =
32-
trait Zip[F[_]]
33-
trait Traverse[F[_]] {
34-
def [A, B, G[_] : Zip](fa: F[A]) traverse(f: A => G[B]): G[F[B]]
35-
}
36-
37-
object instances {
38-
given zipOption as Zip[Option] = ???
39-
given traverseList as Traverse[List] = ???
40-
}
41-
42-
def ff(using xs: Zip[Option]) = ???
43-
44-
ff // error
45-
46-
List(1, 2, 3).traverse(x => Option(x)) // error
47-
48-
locally {
49-
import instances.traverseList
50-
List(1, 2, 3).traverse(x => Option(x)) // error
51-
}
52-
end testLocalInstance

tests/neg/missing-implicit4.check

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
-- Error: tests/neg/missing-implicit4.scala:14:4 -----------------------------------------------------------------------
2+
14 | ff // error
3+
| ^
4+
| no implicit argument of type Zip[Option] was found for parameter xs of method ff
5+
|
6+
| The following import might fix the problem:
7+
|
8+
| import instances.zipOption
9+
|
10+
-- [E008] Not Found Error: tests/neg/missing-implicit4.scala:16:16 -----------------------------------------------------
11+
16 | List(1, 2, 3).traverse(x => Option(x)) // error
12+
| ^^^^^^^^^^^^^^^^^^^^^^
13+
| value traverse is not a member of List[Int], but could be made available as an extension method.
14+
|
15+
| The following import might make progress towards fixing the problem:
16+
|
17+
| import instances.traverseList
18+
|
19+
-- Error: tests/neg/missing-implicit4.scala:20:42 ----------------------------------------------------------------------
20+
20 | List(1, 2, 3).traverse(x => Option(x)) // error
21+
| ^
22+
|no implicit argument of type Zip[Option] was found for an implicit parameter of method traverse in trait Traverse
23+
|
24+
|The following import might fix the problem:
25+
|
26+
| import instances.zipOption
27+
|

tests/neg/missing-implicit4.scala

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
def testLocalInstance =
2+
trait Zip[F[_]]
3+
trait Traverse[F[_]] {
4+
def [A, B, G[_] : Zip](fa: F[A]) traverse(f: A => G[B]): G[F[B]]
5+
}
6+
7+
object instances {
8+
given zipOption as Zip[Option] = ???
9+
given traverseList as Traverse[List] = ???
10+
}
11+
12+
def ff(using xs: Zip[Option]) = ???
13+
14+
ff // error
15+
16+
List(1, 2, 3).traverse(x => Option(x)) // error
17+
18+
locally {
19+
import instances.traverseList
20+
List(1, 2, 3).traverse(x => Option(x)) // error
21+
}
22+
end testLocalInstance

0 commit comments

Comments
 (0)