Skip to content

Commit 4dcb7ce

Browse files
committed
Split test into three files
That way we escape the problem that implicit timeouts are reduced too much for later tests.
1 parent 108cbc8 commit 4dcb7ce

6 files changed

+67
-65
lines changed

tests/neg/missing-implicit-2.check

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
-- Error: tests/neg/missing-implicit-2.scala:4:24 ----------------------------------------------------------------------
2+
4 |val f = Future[Unit] { } // error
3+
| ^
4+
| Cannot find an implicit ExecutionContext. You might pass
5+
| an (implicit ec: ExecutionContext) parameter to your method.
6+
|
7+
| The ExecutionContext is used to configure how and on which
8+
| thread pools Futures will run, so the specific ExecutionContext
9+
| that is selected is important.
10+
|
11+
| If your application does not define an ExecutionContext elsewhere,
12+
| consider using Scala's global ExecutionContext by defining
13+
| the following:
14+
|
15+
| implicit val ec: scala.concurrent.ExecutionContext = scala.concurrent.ExecutionContext.global
16+
|
17+
| The following import might fix the problem:
18+
|
19+
| import concurrent.ExecutionContext.Implicits.global
20+
|
21+
-- [E007] Type Mismatch Error: tests/neg/missing-implicit-2.scala:6:25 -------------------------------------------------
22+
6 |val b: java.lang.Byte = (1: Byte) // error, but no hint
23+
| ^^^^^^^
24+
| Found: Byte
25+
| Required: Byte²
26+
|
27+
| where: Byte is a class in package scala
28+
| Byte² is a class in package java.lang

tests/neg/missing-implicit-2.scala

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Predef.{byte2Byte => _, _}
2+
import scala.concurrent.Future
3+
4+
val f = Future[Unit] { } // error
5+
6+
val b: java.lang.Byte = (1: Byte) // error, but no hint

tests/neg/missing-implicit-3.check

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
-- [E007] Type Mismatch Error: tests/neg/missing-implicit-3.scala:6:44 -------------------------------------------------
2+
6 |val d: scala.concurrent.duration.Duration = (10, DAYS) // error
3+
| ^^^^^^^^^^
4+
| Found: (Int, java.util.concurrent.TimeUnit)
5+
| Required: concurrent².duration.Duration
6+
|
7+
| where: concurrent is a package in package java.util
8+
| concurrent² is a package in package scala
9+
|
10+
|
11+
| The following import might fix the problem:
12+
|
13+
| import concurrent.duration.pairIntToDuration
14+
|
15+
-- [E008] Not Found Error: tests/neg/missing-implicit-3.scala:8:48 -----------------------------------------------------
16+
8 |val d2: scala.concurrent.duration.Duration = 10.days // error
17+
| ^^^^^^^
18+
| value days is not a member of Int, but could be made available as an extension method.
19+
|
20+
| One of the following imports might fix the problem:
21+
|
22+
| import concurrent.duration.DurationInt
23+
| import concurrent.duration.DurationLong
24+
| import concurrent.duration.DurationDouble
25+
|

tests/neg/missing-implicit-3.scala

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Predef.{byte2Byte => _, _}
2+
import math.Numeric
3+
4+
val DAYS = scala.concurrent.duration.DAYS
5+
6+
val d: scala.concurrent.duration.Duration = (10, DAYS) // error
7+
8+
val d2: scala.concurrent.duration.Duration = 10.days // error

tests/neg/missing-implicit.check

-53
Original file line numberDiff line numberDiff line change
@@ -17,56 +17,3 @@
1717
|
1818
| import math.Numeric.Implicits.infixNumericOps
1919
|
20-
-- Error: tests/neg/missing-implicit.scala:10:24 -----------------------------------------------------------------------
21-
10 |val f = Future[Unit] { } // error
22-
| ^
23-
| Cannot find an implicit ExecutionContext. You might pass
24-
| an (implicit ec: ExecutionContext) parameter to your method.
25-
|
26-
| The ExecutionContext is used to configure how and on which
27-
| thread pools Futures will run, so the specific ExecutionContext
28-
| that is selected is important.
29-
|
30-
| If your application does not define an ExecutionContext elsewhere,
31-
| consider using Scala's global ExecutionContext by defining
32-
| the following:
33-
|
34-
| implicit val ec: scala.concurrent.ExecutionContext = scala.concurrent.ExecutionContext.global
35-
|
36-
| The following import might fix the problem:
37-
|
38-
| import concurrent.ExecutionContext.Implicits.global
39-
|
40-
-- [E007] Type Mismatch Error: tests/neg/missing-implicit.scala:12:25 --------------------------------------------------
41-
12 |val b: java.lang.Byte = (1: Byte) // error, but no hint
42-
| ^^^^^^^
43-
| Found: Byte
44-
| Required: Byte²
45-
|
46-
| where: Byte is a class in package scala
47-
| Byte² is a class in package java.lang
48-
-- [E007] Type Mismatch Error: tests/neg/missing-implicit.scala:16:44 --------------------------------------------------
49-
16 |val d: scala.concurrent.duration.Duration = (10, DAYS) // error
50-
| ^^^^^^^^^^
51-
| Found: (Int, java.util.concurrent.TimeUnit)
52-
| Required: concurrent².duration.Duration
53-
|
54-
| where: concurrent is a package in package java.util
55-
| concurrent² is a package in package scala
56-
|
57-
|
58-
| The following import might fix the problem:
59-
|
60-
| import concurrent.duration.pairIntToDuration
61-
|
62-
-- [E008] Not Found Error: tests/neg/missing-implicit.scala:18:48 ------------------------------------------------------
63-
18 |val d2: scala.concurrent.duration.Duration = 10.days // error
64-
| ^^^^^^^
65-
| value days is not a member of Int, but could be made available as an extension method.
66-
|
67-
| One of the following imports might fix the problem:
68-
|
69-
| import concurrent.duration.DurationInt
70-
| import concurrent.duration.DurationLong
71-
| import concurrent.duration.DurationDouble
72-
|

tests/neg/missing-implicit.scala

-12
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,3 @@ import math.Numeric
44
def consume[T: Numeric](xs: List[T], limit: T): List[T] = xs match
55
case x :: xs1 if limit > 0 => consume(xs1, limit - x) // error // error
66
case _ => xs
7-
8-
import scala.concurrent.Future
9-
10-
val f = Future[Unit] { } // error
11-
12-
val b: java.lang.Byte = (1: Byte) // error, but no hint
13-
14-
val DAYS = scala.concurrent.duration.DAYS
15-
16-
val d: scala.concurrent.duration.Duration = (10, DAYS) // error
17-
18-
val d2: scala.concurrent.duration.Duration = 10.days // error

0 commit comments

Comments
 (0)