Kapt: Never mark static methods 'default' (KT-42915)
This commit is contained in:
+1
-1
@@ -814,7 +814,7 @@ class ClassFileToSourceStubConverter(val kaptContext: KaptContextForStubGenerati
|
||||
ElementKind.METHOD, packageFqName, visibleAnnotations, method.invisibleAnnotations, descriptor.annotations
|
||||
)
|
||||
|
||||
if (containingClass.isInterface() && !method.isAbstract()) {
|
||||
if (containingClass.isInterface() && !method.isAbstract() && !method.isStatic()) {
|
||||
modifiers.flags = modifiers.flags or Flags.DEFAULT
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ internal fun ClassNode.isAnnotation() = (access and Opcodes.ACC_ANNOTATION) != 0
|
||||
|
||||
internal fun MethodNode.isVarargs() = (access and Opcodes.ACC_VARARGS) != 0
|
||||
internal fun MethodNode.isAbstract() = (access and Opcodes.ACC_ABSTRACT) != 0
|
||||
internal fun MethodNode.isStatic() = (access and Opcodes.ACC_STATIC) != 0
|
||||
|
||||
internal fun FieldNode.isEnumValue() = (access and Opcodes.ACC_ENUM) != 0
|
||||
|
||||
|
||||
@@ -11,3 +11,10 @@ class JvmStaticTest {
|
||||
const val three: Byte = 3.toByte()
|
||||
const val d: Char = 'D'
|
||||
}
|
||||
|
||||
interface FooComponent {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun create(context: String): String = "foo"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,36 @@
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public abstract interface FooComponent {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public static final FooComponent.Companion Companion = null;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public static java.lang.String create(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static final class Companion {
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String create(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private Companion() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class JvmStaticTest {
|
||||
public final byte three = (byte)3;
|
||||
|
||||
Reference in New Issue
Block a user