Skip to content

Commit

Permalink
Enable -Xjvm-default=all for benchmarks (#3727)
Browse files Browse the repository at this point in the history
And remove usages of JvmDefault, which is going to be deprecated with
error in KT-54746.
  • Loading branch information
udalov authored Apr 26, 2023
1 parent c1cb323 commit ea78820
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ java {
tasks.named<KotlinCompile>("compileJmhKotlin") {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += "-Xjvm-default=enable"
freeCompilerArgs += "-Xjvm-default=all"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ abstract class ShakespearePlaysScrabble {
public interface LongWrapper {
fun get(): Long

@JvmDefault
fun incAndSet(): LongWrapper {
return object : LongWrapper {
override fun get(): Long = this@LongWrapper.get() + 1L
}
}

@JvmDefault
fun add(other: LongWrapper): LongWrapper {
return object : LongWrapper {
override fun get(): Long = this@LongWrapper.get() + other.get()
Expand Down

0 comments on commit ea78820

Please sign in to comment.