Skip to content

Commit

Permalink
build(gradle): Enable consistent copy() visibility
Browse files Browse the repository at this point in the history
Apply upcoming Kotlin 2.1 behavior to align the `copy()` function's
visibility to the visibility of the primary constructor for data classes.
This avoids the new compiler warning with Kotlin 2.0.20 if properties of a
private primary constructor are exposed via `copy()`, even though the
`copy()` function is not called.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Aug 22, 2024
1 parent 456e3fc commit c6701f8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/ort-kotlin-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ tasks.withType<KotlinCompile>().configureEach {

compilerOptions {
allWarningsAsErrors = true
freeCompilerArgs = listOf("-Xconsistent-data-class-copy-visibility")
jvmTarget = maxKotlinJvmTarget
optIn = optInRequirements
}
Expand Down

0 comments on commit c6701f8

Please sign in to comment.