Files
kotlin-fork/plugins/kapt3/kapt3-compiler/testData/converter/jvmDefaultEnable.kt
T
Nicklas Ansman Giertz b02948b5f7 KAPT: Kapt generates illegal stubs for private interface methods
Interface methods that were private got both the `default` and `private`
modifiers when using `jvm-default=all` which is not valid.

The stub will now just contain `private` in this case.

This fixes KT-48013.
2022-09-26 12:21:56 +02:00

25 lines
499 B
Kotlin
Vendored

// !JVM_DEFAULT_MODE: enable
// EXPECTED_ERROR: (kotlin:20:5) modifier private not allowed here
interface Foo {
fun foo() {
System.out.println("foo")
}
@JvmDefault
fun foo2(a: Int) {
System.out.println("foo2")
}
fun bar()
private fun privateMethodWithDefault() {
System.out.println("privateMethodWithDefault")
}
@JvmDefault
private fun privateMethodWithDefault2() {
System.out.println("privateMethodWithDefault2")
}
}