Skip to content

Commit 9d428fd

Browse files
authored
Regression test #16004 (#24086)
Closes #16004 Fixed on 3.2.2 Minimization by @armanbilge at #16004 (comment)
1 parent 572e562 commit 9d428fd

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

tests/pos/i16004.scala

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
import scala.concurrent.duration.FiniteDuration
3+
import scala.concurrent.duration._
4+
5+
trait Resource[F[_], A]
6+
trait IO[A]
7+
8+
trait Cache[F[_], K, V]
9+
10+
object Cache {
11+
12+
final case class Config(expireAfterRead: FiniteDuration)
13+
14+
def expiring[F[_], K, V](
15+
expireAfter: FiniteDuration
16+
): Resource[F, Cache[F, K, V]] = ???
17+
18+
def expiring[F[_], K, V](
19+
config: Config,
20+
partitions: Option[Int] = None
21+
): Resource[F, Cache[F, K, V]] = ???
22+
23+
/* Without partitions being specified, error is yielded */
24+
25+
val notCompiling = expiring[IO, Int, Int](
26+
config = Config(expireAfterRead = 1.minute)
27+
)
28+
29+
val compiling = expiring[IO, Int, Int](
30+
config = Config(expireAfterRead = 1.minute),
31+
partitions = None
32+
)
33+
}

0 commit comments

Comments
 (0)