Skip to content

Investigate Kotlin 2.1 compiler warnings for contracts #4371

@marcphilipp

Description

@marcphilipp

The Kotlin contracts introduced in #1866 cause the following warnings after bumping apiVersion and languageVersion to 2.1 on the marc/jdk17 branch.

w: junit-jupiter-api/src/main/kotlin/org/junit/jupiter/api/Assertions.kt:414:9 Wrong invocation kind 'EXACTLY_ONCE' for 'executable: () -> R' specified, the actual invocation kind is 'AT_MOST_ONCE'.
w: junit-jupiter-api/src/main/kotlin/org/junit/jupiter/api/Assertions.kt:442:9 Wrong invocation kind 'EXACTLY_ONCE' for 'executable: () -> R' specified, the actual invocation kind is 'AT_MOST_ONCE'.
w: junit-jupiter-api/src/main/kotlin/org/junit/jupiter/api/Assertions.kt:466:9 Wrong invocation kind 'EXACTLY_ONCE' for 'executable: () -> R' specified, the actual invocation kind is 'AT_MOST_ONCE'.
w: junit-jupiter-api/src/main/kotlin/org/junit/jupiter/api/Assertions.kt:490:9 Wrong invocation kind 'EXACTLY_ONCE' for 'executable: () -> R' specified, the actual invocation kind is 'AT_MOST_ONCE'.

These warnings can be reproduced by running ./gradlew :junit-jupiter-api:compileKotlin --rerun

They are currently not treated as errors:

compileKotlin {
// https://github.com/junit-team/junit5/issues/4371
compilerOptions.allWarningsAsErrors = false
}

Deliverables

  • Resolve the warnings or suppress them if they're false positives

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions