drop deprecated @platformName and @platformStatic annotations
This commit is contained in:
+2
-2
@@ -66,7 +66,7 @@ public class DefaultParameterValueSubstitutor(val state: GenerationState) {
|
||||
*
|
||||
* @param functionDescriptor the method for which the overloads are generated
|
||||
* @param delegateFunctionDescriptor the method descriptor for the implementation that we need to call
|
||||
* (same as [functionDescriptor] in all cases except for companion object methods annotated with [platformStatic],
|
||||
* (same as [functionDescriptor] in all cases except for companion object methods annotated with @JvmStatic,
|
||||
* where [functionDescriptor] is the static method in the main class and [delegateFunctionDescriptor] is the
|
||||
* implementation in the companion object class)
|
||||
* @return true if the overloads annotation was found on the element, false otherwise
|
||||
@@ -102,7 +102,7 @@ public class DefaultParameterValueSubstitutor(val state: GenerationState) {
|
||||
*
|
||||
* @param functionDescriptor the method for which the overloads are generated
|
||||
* @param delegateFunctionDescriptor the method descriptor for the implementation that we need to call
|
||||
* (same as [functionDescriptor] in all cases except for companion object methods annotated with [platformStatic],
|
||||
* (same as [functionDescriptor] in all cases except for companion object methods annotated with @JvmStatic,
|
||||
* where [functionDescriptor] is the static method in the main class and [delegateFunctionDescriptor] is the
|
||||
* implementation in the companion object class)
|
||||
* @param methodElement the PSI element for the method implementation (used in diagnostic messages only)
|
||||
|
||||
@@ -187,7 +187,7 @@ public class FunctionCodegen {
|
||||
boolean staticInCompanionObject = AnnotationUtilKt.isPlatformStaticInCompanionObject(functionDescriptor);
|
||||
if (staticInCompanionObject) {
|
||||
ImplementationBodyCodegen parentBodyCodegen = (ImplementationBodyCodegen) memberCodegen.getParentCodegen();
|
||||
parentBodyCodegen.addAdditionalTask(new PlatformStaticGenerator(functionDescriptor, origin, state));
|
||||
parentBodyCodegen.addAdditionalTask(new JvmStaticGenerator(functionDescriptor, origin, state));
|
||||
}
|
||||
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.LIGHT_CLASSES || isAbstractMethod(functionDescriptor, contextKind)) {
|
||||
@@ -209,9 +209,9 @@ public class FunctionCodegen {
|
||||
generateMethodBody(mv, functionDescriptor, methodContext, jvmSignature, strategy, memberCodegen);
|
||||
}
|
||||
else if (staticInCompanionObject) {
|
||||
// native platformStatic foo() in companion object should delegate to the static native function moved to the outer class
|
||||
// native @JvmStatic foo() in companion object should delegate to the static native function moved to the outer class
|
||||
mv.visitCode();
|
||||
FunctionDescriptor staticFunctionDescriptor = PlatformStaticGenerator.createStaticFunctionDescriptor(functionDescriptor);
|
||||
FunctionDescriptor staticFunctionDescriptor = JvmStaticGenerator.createStaticFunctionDescriptor(functionDescriptor);
|
||||
JvmMethodSignature jvmMethodSignature =
|
||||
typeMapper.mapSignature(memberCodegen.getContext().accessibleDescriptor(staticFunctionDescriptor, null));
|
||||
Type owningType = typeMapper.mapClass((ClassifierDescriptor) staticFunctionDescriptor.getContainingDeclaration());
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature
|
||||
import org.jetbrains.org.objectweb.asm.MethodVisitor
|
||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
|
||||
|
||||
class PlatformStaticGenerator(
|
||||
class JvmStaticGenerator(
|
||||
val descriptor: FunctionDescriptor,
|
||||
val declarationOrigin: JvmDeclarationOrigin,
|
||||
val state: GenerationState
|
||||
@@ -16,21 +16,15 @@
|
||||
|
||||
package org.jetbrains.kotlin.cli.jvm
|
||||
|
||||
import kotlin.platform.*
|
||||
import java.util.jar.JarFile
|
||||
import java.util.jar.Attributes
|
||||
import java.util.regex.Pattern
|
||||
import com.intellij.util.containers.MultiMap
|
||||
import java.net.URLClassLoader
|
||||
import java.net.URL
|
||||
import java.io.File
|
||||
import java.util.ServiceLoader
|
||||
import java.io.IOException
|
||||
import java.util.Enumeration
|
||||
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
|
||||
import org.jetbrains.kotlin.utils.valuesToMap
|
||||
import org.jetbrains.kotlin.config.CompilerConfiguration
|
||||
import org.jetbrains.kotlin.compiler.plugin.*
|
||||
import org.jetbrains.kotlin.config.CompilerConfiguration
|
||||
import org.jetbrains.kotlin.utils.valuesToMap
|
||||
import java.io.File
|
||||
import java.net.URL
|
||||
import java.net.URLClassLoader
|
||||
import java.util.*
|
||||
|
||||
|
||||
public object PluginCliParser {
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ import org.jetbrains.kotlin.resolve.DeclarationChecker
|
||||
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
import org.jetbrains.kotlin.resolve.annotations.hasIntrinsicAnnotation
|
||||
import org.jetbrains.kotlin.resolve.annotations.hasPlatformStaticAnnotation
|
||||
import org.jetbrains.kotlin.resolve.annotations.hasJvmStaticAnnotation
|
||||
import org.jetbrains.kotlin.resolve.inline.InlineUtil
|
||||
import org.jetbrains.kotlin.resolve.jvm.annotations.hasJvmOverloadsAnnotation
|
||||
import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm
|
||||
@@ -58,7 +58,7 @@ public class PlatformStaticAnnotationChecker : DeclarationChecker {
|
||||
diagnosticHolder: DiagnosticSink,
|
||||
bindingContext: BindingContext
|
||||
) {
|
||||
if (descriptor.hasPlatformStaticAnnotation()) {
|
||||
if (descriptor.hasJvmStaticAnnotation()) {
|
||||
if (declaration is KtNamedFunction || declaration is KtProperty || declaration is KtPropertyAccessor) {
|
||||
checkDeclaration(declaration, descriptor, diagnosticHolder)
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class MainFunctionDetector {
|
||||
DeclarationDescriptor containingDeclaration = functionDescriptor.getContainingDeclaration();
|
||||
return containingDeclaration instanceof ClassDescriptor
|
||||
&& ((ClassDescriptor) containingDeclaration).getKind().isSingleton()
|
||||
&& AnnotationUtilKt.hasPlatformStaticAnnotation(functionDescriptor);
|
||||
&& AnnotationUtilKt.hasJvmStaticAnnotation(functionDescriptor);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -16,14 +16,13 @@
|
||||
|
||||
package org.jetbrains.kotlin.kdoc.parser
|
||||
|
||||
import com.intellij.lang.ASTNode
|
||||
import com.intellij.lang.PsiBuilder
|
||||
import com.intellij.lang.PsiBuilderFactory
|
||||
import com.intellij.lang.PsiParser
|
||||
import com.intellij.psi.tree.IElementType
|
||||
import com.intellij.lang.PsiBuilder
|
||||
import com.intellij.lang.ASTNode
|
||||
import org.jetbrains.kotlin.lexer.KtTokens
|
||||
import org.jetbrains.kotlin.lexer.KotlinLexer
|
||||
import com.intellij.lang.PsiBuilderFactory
|
||||
import kotlin.platform.*
|
||||
import org.jetbrains.kotlin.lexer.KtTokens
|
||||
|
||||
/**
|
||||
* Parses the contents of a Markdown link in KDoc. Uses the standard Kotlin lexer.
|
||||
|
||||
@@ -22,13 +22,11 @@ import org.jetbrains.kotlin.descriptors.PropertyAccessorDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget
|
||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||
import org.jetbrains.kotlin.lexer.KtTokens
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
|
||||
public fun DeclarationDescriptor.hasPlatformStaticAnnotation(): Boolean {
|
||||
return getAnnotations().findAnnotation(FqName("kotlin.platform.platformStatic")) != null ||
|
||||
getAnnotations().findAnnotation(FqName("kotlin.jvm.JvmStatic")) != null
|
||||
public fun DeclarationDescriptor.hasJvmStaticAnnotation(): Boolean {
|
||||
return getAnnotations().findAnnotation(FqName("kotlin.jvm.JvmStatic")) != null
|
||||
}
|
||||
|
||||
public fun DeclarationDescriptor.hasJvmSyntheticAnnotation(): Boolean {
|
||||
@@ -52,9 +50,9 @@ private fun CallableDescriptor.isPlatformStaticIn(predicate: (DeclarationDescrip
|
||||
is PropertyAccessorDescriptor -> {
|
||||
val propertyDescriptor = getCorrespondingProperty()
|
||||
predicate(propertyDescriptor.getContainingDeclaration()) &&
|
||||
(hasPlatformStaticAnnotation() || propertyDescriptor.hasPlatformStaticAnnotation())
|
||||
(hasJvmStaticAnnotation() || propertyDescriptor.hasJvmStaticAnnotation())
|
||||
}
|
||||
else -> predicate(getContainingDeclaration()) && hasPlatformStaticAnnotation()
|
||||
else -> predicate(getContainingDeclaration()) && hasJvmStaticAnnotation()
|
||||
}
|
||||
|
||||
public fun AnnotationDescriptor.argumentValue(parameterName: String): Any? {
|
||||
|
||||
+1
-3
@@ -1,10 +1,8 @@
|
||||
package test
|
||||
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
class PlatformStaticClass {
|
||||
companion object {
|
||||
@platformStatic
|
||||
@JvmStatic
|
||||
fun <T> inClassObject() {}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+2
-3
@@ -1,10 +1,9 @@
|
||||
import kotlin.platform.platformName
|
||||
import kotlin.reflect.jvm.*
|
||||
|
||||
var state: String = "value"
|
||||
@platformName("getter")
|
||||
@JvmName("getter")
|
||||
get
|
||||
@platformName("setter")
|
||||
@JvmName("setter")
|
||||
set
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package foo
|
||||
|
||||
import kotlin.jvm.*
|
||||
import kotlin.platform.*
|
||||
|
||||
object ObjWithNative {
|
||||
external fun foo(x: Int = 1): Double
|
||||
|
||||
@platformStatic external fun bar(l: Long, s: String = ""): Double
|
||||
@JvmStatic external fun bar(l: Long, s: String = ""): Double
|
||||
}
|
||||
|
||||
external fun topLevel(x: Int = 1): Double
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import kotlin.jvm.*
|
||||
import kotlin.platform.*
|
||||
|
||||
class C {
|
||||
companion object {
|
||||
private @platformStatic external fun foo()
|
||||
private @JvmStatic external fun foo()
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package foo
|
||||
|
||||
import kotlin.jvm.*
|
||||
import kotlin.platform.*
|
||||
|
||||
class WithNative {
|
||||
companion object {
|
||||
@platformStatic external fun bar(l: Long, s: String): Double
|
||||
@JvmStatic external fun bar(l: Long, s: String): Double
|
||||
}
|
||||
}
|
||||
|
||||
object ObjWithNative {
|
||||
@platformStatic external fun bar(l: Long, s: String): Double
|
||||
@JvmStatic external fun bar(l: Long, s: String): Double
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package foo
|
||||
|
||||
import kotlin.jvm.*
|
||||
import kotlin.platform.*
|
||||
|
||||
external fun bar(l: Long, s: String): Double
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import kotlin.platform.*
|
||||
|
||||
@platformName("bar")
|
||||
@JvmName("bar")
|
||||
fun foo() = "foo"
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import kotlin.platform.*
|
||||
|
||||
fun <T> List<T>.foo() = "foo"
|
||||
|
||||
@platformName("fooInt")
|
||||
@JvmName("fooInt")
|
||||
fun List<Int>.foo() = "fooInt"
|
||||
|
||||
fun box(): String {
|
||||
|
||||
+10
-12
@@ -1,5 +1,3 @@
|
||||
import kotlin.platform.*
|
||||
|
||||
// See:
|
||||
// http://kotlinlang.org/docs/reference/java-interop.html#handling-signature-clashes-with-platformname
|
||||
// https://youtrack.jetbrains.com/issue/KT-5524
|
||||
@@ -10,18 +8,18 @@ val ints = listOf(1, 2, 3)
|
||||
class C {
|
||||
// Instance methods
|
||||
|
||||
@platformName("instMethodStr")
|
||||
@JvmName("instMethodStr")
|
||||
fun instMethod(list: List<String>): String = "instMethodStr"
|
||||
|
||||
@platformName("instMethodInt")
|
||||
@JvmName("instMethodInt")
|
||||
fun instMethod(list: List<Int>): String = "instMethodInt"
|
||||
|
||||
// Properties
|
||||
|
||||
var rwProperty: Int
|
||||
@platformName("get_rwProperty")
|
||||
@JvmName("get_rwProperty")
|
||||
get() = 123
|
||||
@platformName("set_rwProperty")
|
||||
@JvmName("set_rwProperty")
|
||||
set(v) {}
|
||||
|
||||
var rwValue = 111
|
||||
@@ -36,27 +34,27 @@ class C {
|
||||
|
||||
class Inner
|
||||
|
||||
@platformName("extMethodWithGenericParamStr")
|
||||
@JvmName("extMethodWithGenericParamStr")
|
||||
fun Inner.extMethodWithGenericParam(list: List<String>): String = "extMethodWithGenericParamStr"
|
||||
|
||||
@platformName("extMethodWithGenericParamInt")
|
||||
@JvmName("extMethodWithGenericParamInt")
|
||||
fun Inner.extMethodWithGenericParam(list: List<Int>): String = "extMethodWithGenericParamInt"
|
||||
|
||||
// This is already covered by extMethodWithGenericParam(), but might be relevant for a platform
|
||||
// with extension method code generation strategy different from Java 6.
|
||||
|
||||
@platformName("extMethodWithGenericReceiverStr")
|
||||
@JvmName("extMethodWithGenericReceiverStr")
|
||||
fun List<String>.extMethodWithGenericReceiver(): String = "extMethodWithGenericReceiverStr"
|
||||
|
||||
@platformName("extMethodWithGenericReceiverInt")
|
||||
@JvmName("extMethodWithGenericReceiverInt")
|
||||
fun List<Int>.extMethodWithGenericReceiver(): String = "extMethodWithGenericReceiverInt"
|
||||
|
||||
// Extension method vs instance method
|
||||
|
||||
@platformName("ambigMethod1")
|
||||
@JvmName("ambigMethod1")
|
||||
fun ambigMethod(str: String): String = "ambigMethod1"
|
||||
|
||||
@platformName("ambigMethod2")
|
||||
@JvmName("ambigMethod2")
|
||||
fun String.ambigMethod(): String = "ambigMethod2"
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import kotlin.platform.*
|
||||
|
||||
@platformName("bar")
|
||||
@JvmName("bar")
|
||||
fun foo() = "foo"
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import kotlin.platform.*
|
||||
|
||||
var v: Int = 1
|
||||
@platformName("vget")
|
||||
@JvmName("vget")
|
||||
get
|
||||
@platformName("vset")
|
||||
@JvmName("vset")
|
||||
set
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class C {
|
||||
companion object {
|
||||
@kotlin.platform.platformStatic @kotlin.jvm.JvmOverloads public fun foo(o: String, k: String = "K"): String {
|
||||
@JvmStatic @kotlin.jvm.JvmOverloads public fun foo(o: String, k: String = "K"): String {
|
||||
return o + k
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
object A {
|
||||
|
||||
val b: String = "OK"
|
||||
|
||||
@platformStatic val c: String = "OK"
|
||||
@JvmStatic val c: String = "OK"
|
||||
|
||||
@platformStatic fun test1() : String {
|
||||
@JvmStatic fun test1() : String {
|
||||
return {b}()
|
||||
}
|
||||
|
||||
@platformStatic fun test2() : String {
|
||||
@JvmStatic fun test2() : String {
|
||||
return {test1()}()
|
||||
}
|
||||
|
||||
@@ -18,11 +16,11 @@ object A {
|
||||
return {"1".test5()}()
|
||||
}
|
||||
|
||||
@platformStatic fun test4(): String {
|
||||
@JvmStatic fun test4(): String {
|
||||
return {"1".test5()}()
|
||||
}
|
||||
|
||||
@platformStatic fun String.test5() : String {
|
||||
@JvmStatic fun String.test5() : String {
|
||||
return {this + b}()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
class B(var s: Int = 0) {
|
||||
|
||||
}
|
||||
@@ -10,7 +8,7 @@ object A {
|
||||
v += B(1000)
|
||||
}
|
||||
|
||||
@platformStatic fun B.plusAssign(b: B) {
|
||||
@JvmStatic fun B.plusAssign(b: B) {
|
||||
this.s += b.s
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
object A {
|
||||
|
||||
@platformStatic fun test(b: String = "OK") : String {
|
||||
@JvmStatic fun test(b: String = "OK") : String {
|
||||
return b
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
object AX {
|
||||
|
||||
@platformStatic val c: String = "OK"
|
||||
@JvmStatic val c: String = "OK"
|
||||
|
||||
@platformStatic fun aStatic(): String {
|
||||
@JvmStatic fun aStatic(): String {
|
||||
return AX.b()
|
||||
}
|
||||
|
||||
@@ -12,7 +10,7 @@ object AX {
|
||||
return AX.b()
|
||||
}
|
||||
|
||||
@platformStatic fun b(): String {
|
||||
@JvmStatic fun b(): String {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
var holder = ""
|
||||
|
||||
fun getA(): A {
|
||||
@@ -8,7 +6,7 @@ fun getA(): A {
|
||||
}
|
||||
|
||||
object A {
|
||||
@platformStatic fun a(): String {
|
||||
@JvmStatic fun a(): String {
|
||||
return holder
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
object A {
|
||||
|
||||
@platformStatic inline fun test(b: String = "OK") : String {
|
||||
@JvmStatic inline fun test(b: String = "OK") : String {
|
||||
return b
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
object A {
|
||||
|
||||
@platformStatic var a: Int = 1
|
||||
@JvmStatic var a: Int = 1
|
||||
|
||||
var b: Int = 1
|
||||
@platformStatic get
|
||||
@JvmStatic get
|
||||
|
||||
var c: Int = 1
|
||||
@platformStatic set
|
||||
@JvmStatic set
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
object A {
|
||||
|
||||
@platformStatic var a: Int = 1
|
||||
@JvmStatic var a: Int = 1
|
||||
|
||||
var b: Int = 1
|
||||
@platformStatic get
|
||||
@JvmStatic get
|
||||
|
||||
var c: Int = 1
|
||||
@platformStatic set
|
||||
@JvmStatic set
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
object A {
|
||||
|
||||
private @platformStatic fun a(): String {
|
||||
private @JvmStatic fun a(): String {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
var holder = ""
|
||||
|
||||
fun getA(): A {
|
||||
@@ -9,13 +7,13 @@ fun getA(): A {
|
||||
|
||||
object A {
|
||||
|
||||
@platformStatic var a: Int = 1
|
||||
@JvmStatic var a: Int = 1
|
||||
|
||||
var b: Int = 1
|
||||
@platformStatic get
|
||||
@JvmStatic get
|
||||
|
||||
var c: Int = 1
|
||||
@platformStatic set
|
||||
@JvmStatic set
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
object X {
|
||||
@platformStatic val x = "OK"
|
||||
@JvmStatic val x = "OK"
|
||||
|
||||
fun fn(value : String = x): String = value
|
||||
}
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
object A {
|
||||
|
||||
val b: String = "OK"
|
||||
|
||||
@platformStatic val c: String = "OK"
|
||||
@JvmStatic val c: String = "OK"
|
||||
|
||||
@platformStatic fun test1() : String {
|
||||
@JvmStatic fun test1() : String {
|
||||
return b
|
||||
}
|
||||
|
||||
@platformStatic fun test2() : String {
|
||||
@JvmStatic fun test2() : String {
|
||||
return test1()
|
||||
}
|
||||
|
||||
@@ -18,11 +16,11 @@ object A {
|
||||
return "1".test5()
|
||||
}
|
||||
|
||||
@platformStatic fun test4(): String {
|
||||
@JvmStatic fun test4(): String {
|
||||
return "1".test5()
|
||||
}
|
||||
|
||||
@platformStatic fun String.test5() : String {
|
||||
@JvmStatic fun String.test5() : String {
|
||||
return this + b
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import kotlin.platform.*
|
||||
|
||||
class C {
|
||||
companion object {
|
||||
private @platformStatic fun foo(): String {
|
||||
private @JvmStatic fun foo(): String {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ class A {
|
||||
}
|
||||
|
||||
object O {
|
||||
@kotlin.platform.platformStatic fun baz() {}
|
||||
@JvmStatic fun baz() {}
|
||||
}
|
||||
|
||||
fun nullableUnit(unit: Boolean): Unit? = if (unit) Unit else null
|
||||
|
||||
+1
-3
@@ -1,13 +1,11 @@
|
||||
package test
|
||||
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
open class B
|
||||
|
||||
class A {
|
||||
|
||||
companion object {
|
||||
@platformStatic
|
||||
@JvmStatic
|
||||
fun <T: B> a(s: T) : T {
|
||||
return s
|
||||
}
|
||||
|
||||
+3
-5
@@ -1,20 +1,18 @@
|
||||
package test
|
||||
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
class A {
|
||||
|
||||
companion object {
|
||||
val b: String = "OK"
|
||||
|
||||
@platformStatic fun test1() {
|
||||
@JvmStatic fun test1() {
|
||||
b
|
||||
test2()
|
||||
test3()
|
||||
"".test4()
|
||||
}
|
||||
|
||||
@platformStatic fun test2() {
|
||||
@JvmStatic fun test2() {
|
||||
b
|
||||
}
|
||||
|
||||
@@ -22,7 +20,7 @@ class A {
|
||||
|
||||
}
|
||||
|
||||
@platformStatic fun String.test4() {
|
||||
@JvmStatic fun String.test4() {
|
||||
b
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -8,10 +8,10 @@ public final class A {
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public final val b: kotlin.String
|
||||
@kotlin.platform.platformStatic() public final fun test1(): kotlin.Unit
|
||||
@kotlin.platform.platformStatic() public final fun test2(): kotlin.Unit
|
||||
@kotlin.jvm.JvmStatic() public final fun test1(): kotlin.Unit
|
||||
@kotlin.jvm.JvmStatic() public final fun test2(): kotlin.Unit
|
||||
public final fun test3(): kotlin.Unit
|
||||
@kotlin.platform.platformStatic() public final fun kotlin.String.test4(): kotlin.Unit
|
||||
@kotlin.jvm.JvmStatic() public final fun kotlin.String.test4(): kotlin.Unit
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-5
@@ -1,14 +1,12 @@
|
||||
package test
|
||||
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
class A {
|
||||
companion object {
|
||||
@platformStatic val b: String = "OK"
|
||||
@JvmStatic val b: String = "OK"
|
||||
|
||||
var A.c: String
|
||||
@platformStatic get() = "OK"
|
||||
@platformStatic set(t: String) {}
|
||||
@JvmStatic get() = "OK"
|
||||
@JvmStatic set(t: String) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ public final class A {
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
@kotlin.platform.platformStatic() public final val b: kotlin.String
|
||||
@kotlin.jvm.JvmStatic() public final val b: kotlin.String
|
||||
public final var test.A.c: kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
package test
|
||||
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
object A {
|
||||
|
||||
val b: String = "OK"
|
||||
|
||||
@platformStatic fun test1() {
|
||||
@JvmStatic fun test1() {
|
||||
b
|
||||
test2()
|
||||
test3()
|
||||
"".test4()
|
||||
}
|
||||
|
||||
@platformStatic fun test2() {
|
||||
@JvmStatic fun test2() {
|
||||
b
|
||||
}
|
||||
|
||||
@@ -21,7 +19,7 @@ object A {
|
||||
|
||||
}
|
||||
|
||||
@platformStatic fun String.test4() {
|
||||
@JvmStatic fun String.test4() {
|
||||
b
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ public fun main(/*0*/ kotlin.Array<kotlin.String>): kotlin.Unit
|
||||
public object A {
|
||||
private constructor A()
|
||||
public final val b: kotlin.String
|
||||
@kotlin.platform.platformStatic() public final fun test1(): kotlin.Unit
|
||||
@kotlin.platform.platformStatic() public final fun test2(): kotlin.Unit
|
||||
@kotlin.jvm.JvmStatic() public final fun test1(): kotlin.Unit
|
||||
@kotlin.jvm.JvmStatic() public final fun test2(): kotlin.Unit
|
||||
public final fun test3(): kotlin.Unit
|
||||
@kotlin.platform.platformStatic() public final fun kotlin.String.test4(): kotlin.Unit
|
||||
@kotlin.jvm.JvmStatic() public final fun kotlin.String.test4(): kotlin.Unit
|
||||
}
|
||||
|
||||
public/*package*/ open class Test {
|
||||
|
||||
+3
-5
@@ -1,13 +1,11 @@
|
||||
package test
|
||||
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
object A {
|
||||
@platformStatic val b: String = "OK"
|
||||
@JvmStatic val b: String = "OK"
|
||||
|
||||
var A.c: String
|
||||
@platformStatic get() = "OK"
|
||||
@platformStatic set(t: String) {}
|
||||
@JvmStatic get() = "OK"
|
||||
@JvmStatic set(t: String) {}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ public fun main(/*0*/ kotlin.Array<kotlin.String>): kotlin.Unit
|
||||
|
||||
public object A {
|
||||
private constructor A()
|
||||
@kotlin.platform.platformStatic() public final val b: kotlin.String
|
||||
@kotlin.jvm.JvmStatic() public final val b: kotlin.String
|
||||
public final var test.A.c: kotlin.String
|
||||
}
|
||||
|
||||
|
||||
+2
-4
@@ -1,9 +1,7 @@
|
||||
package test
|
||||
|
||||
import kotlin.platform.*
|
||||
|
||||
var v: Int = 1
|
||||
@platformName("vget")
|
||||
@JvmName("vget")
|
||||
get
|
||||
@platformName("vset")
|
||||
@JvmName("vset")
|
||||
set
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package lib
|
||||
|
||||
import kotlin.platform.*
|
||||
|
||||
@platformName("bar")
|
||||
@JvmName("bar")
|
||||
fun foo() = "foo"
|
||||
|
||||
var v: Int = 1
|
||||
@platformName("vget")
|
||||
@JvmName("vget")
|
||||
get
|
||||
@platformName("vset")
|
||||
@JvmName("vset")
|
||||
set
|
||||
|
||||
+3
-5
@@ -1,18 +1,16 @@
|
||||
package test
|
||||
|
||||
import kotlin.platform.*
|
||||
|
||||
annotation class A(val s: String)
|
||||
|
||||
@platformName("bar")
|
||||
@A("1")
|
||||
@JvmName("bar")
|
||||
fun foo() = "foo"
|
||||
|
||||
@field:A("2")
|
||||
var v: Int = 1
|
||||
@platformName("vget")
|
||||
@A("3")
|
||||
@JvmName("vget")
|
||||
get
|
||||
@platformName("vset")
|
||||
@A("4")
|
||||
@JvmName("vset")
|
||||
set
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
package test
|
||||
|
||||
@field:test.A(s = "2") public var v: kotlin.Int
|
||||
@kotlin.platform.platformName(name = "vget") @test.A(s = "3") public fun <get-v>(): kotlin.Int
|
||||
@kotlin.platform.platformName(name = "vset") @test.A(s = "4") public fun <set-v>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit
|
||||
@kotlin.platform.platformName(name = "bar") @test.A(s = "1") public fun foo(): kotlin.String
|
||||
@test.A(s = "3") @kotlin.jvm.JvmName(name = "vget") public fun <get-v>(): kotlin.Int
|
||||
@test.A(s = "4") @kotlin.jvm.JvmName(name = "vset") public fun <set-v>(/*0*/ <set-?>: kotlin.Int): kotlin.Unit
|
||||
@test.A(s = "1") @kotlin.jvm.JvmName(name = "bar") public fun foo(): kotlin.String
|
||||
|
||||
public final annotation class A : kotlin.Annotation {
|
||||
/*primary*/ public constructor A(/*0*/ s: kotlin.String)
|
||||
|
||||
Reference in New Issue
Block a user