Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions tests/pos/i16004.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

import scala.concurrent.duration.FiniteDuration
import scala.concurrent.duration._

trait Resource[F[_], A]
trait IO[A]

trait Cache[F[_], K, V]

object Cache {

final case class Config(expireAfterRead: FiniteDuration)

def expiring[F[_], K, V](
expireAfter: FiniteDuration
): Resource[F, Cache[F, K, V]] = ???

def expiring[F[_], K, V](
config: Config,
partitions: Option[Int] = None
): Resource[F, Cache[F, K, V]] = ???

/* Without partitions being specified, error is yielded */

val notCompiling = expiring[IO, Int, Int](
config = Config(expireAfterRead = 1.minute)
)

val compiling = expiring[IO, Int, Int](
config = Config(expireAfterRead = 1.minute),
partitions = None
)
}
Loading