diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 114b6d970ae..27e260108cc 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -179,7 +179,7 @@ jobs: - name: jvmTest (K2 enabled) uses: gradle/gradle-build-action@v2 with: - arguments: "jvmTest -Pkotlin_version=2.0.0-dev-5387 -Pkotlin_repo_url=https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap -Pkotlin_language_version=2.0" + arguments: "jvmTest -Pkotlin_version=2.0.0-dev-6573 -Pkotlin_repo_url=https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap -Pkotlin_language_version=2.0 -Pkotlin_api_version=2.0" - name: Upload reports if: failure() diff --git a/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/IterableTest.kt b/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/IterableTest.kt index fbc4acde102..0ee9cf24f08 100644 --- a/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/IterableTest.kt +++ b/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/IterableTest.kt @@ -1,3 +1,5 @@ +@file:Suppress("DUPLICATE_PARAMETER_NAME_IN_FUNCTION_TYPE") + package arrow.core import arrow.core.test.either diff --git a/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/SequenceKTest.kt b/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/SequenceKTest.kt index a05b88c2f1a..17d2c11c917 100644 --- a/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/SequenceKTest.kt +++ b/arrow-libs/core/arrow-core/src/commonTest/kotlin/arrow/core/SequenceKTest.kt @@ -1,3 +1,5 @@ +@file:Suppress("DUPLICATE_PARAMETER_NAME_IN_FUNCTION_TYPE") + package arrow.core import arrow.core.test.laws.MonoidLaws diff --git a/arrow-libs/resilience/arrow-resilience/src/commonMain/kotlin/arrow/resilience/CircuitBreaker.kt b/arrow-libs/resilience/arrow-resilience/src/commonMain/kotlin/arrow/resilience/CircuitBreaker.kt index d40ba606a65..c1950a7befd 100644 --- a/arrow-libs/resilience/arrow-resilience/src/commonMain/kotlin/arrow/resilience/CircuitBreaker.kt +++ b/arrow-libs/resilience/arrow-resilience/src/commonMain/kotlin/arrow/resilience/CircuitBreaker.kt @@ -520,24 +520,28 @@ private constructor( onClosed: suspend () -> Unit = suspend { }, onHalfOpen: suspend () -> Unit = suspend { }, onOpen: suspend () -> Unit = suspend { } - ): CircuitBreaker = - CircuitBreaker( + ): CircuitBreaker { + require(resetTimeout > Duration.ZERO) { + "resetTimeout expected to be greater than ${Duration.ZERO}, but was $resetTimeout" + } + require(exponentialBackoffFactor > 0) { + "exponentialBackoffFactor expected to be greater than 0, but was $exponentialBackoffFactor" + } + require(maxResetTimeout > Duration.ZERO) { + "maxResetTimeout expected to be greater than ${Duration.ZERO}, but was $maxResetTimeout" + } + return CircuitBreaker( state = Atomic(Closed(openingStrategy)), - resetTimeout = resetTimeout - .takeIf { it.isPositive() && it != Duration.ZERO } - .let { requireNotNull(it) { "resetTimeout expected to be greater than ${Duration.ZERO}, but was $resetTimeout" } }, - exponentialBackoffFactor = exponentialBackoffFactor - .takeIf { it > 0 } - .let { requireNotNull(it) { "exponentialBackoffFactor expected to be greater than 0, but was $exponentialBackoffFactor" } }, - maxResetTimeout = maxResetTimeout - .takeIf { it.isPositive() && it != Duration.ZERO } - .let { requireNotNull(it) { "maxResetTimeout expected to be greater than ${Duration.ZERO}, but was $maxResetTimeout" } }, + resetTimeout = resetTimeout, + exponentialBackoffFactor = exponentialBackoffFactor, + maxResetTimeout = maxResetTimeout, timeSource = timeSource, onRejected = onRejected, onClosed = onClosed, onHalfOpen = onHalfOpen, onOpen = onOpen ) + } } public sealed class OpeningStrategy { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 97239cc13cd..09cf16edb6b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,15 +8,15 @@ dokka = "1.9.10" jUnit = "4.13.2" jUnitJupiter = "5.10.0" jUnitVintage = "5.10.0" -kotest = "5.7.2" -kotestGradle = "5.7.2" +kotest = "5.8.0" +kotestGradle = "5.8.0" kover = "0.7.4" -kotlin = "1.9.10" -kotlinxSerializationPlugin = "1.9.10" +kotlin = "1.9.20" +kotlinxSerializationPlugin = "1.9.20" kotlinBinaryCompatibilityValidator = "0.13.2" kotlinCompileTesting = "1.5.0" knit = "0.4.0" -kspVersion = "1.9.10-1.0.13" +kspVersion = "1.9.20-1.0.14" kotlinxSerialization = "1.6.0" mockWebServer = "4.12.0" retrofit = "2.9.0"