Update IDE tests to use KProperty instead of PropertyMetadata
This commit is contained in:
+2
-2
@@ -2,8 +2,8 @@
|
||||
package first
|
||||
|
||||
fun firstFun() {
|
||||
val a = PropertyM<caret>
|
||||
val a = KProp<caret>
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 1
|
||||
// EXIST: { lookupString:"PropertyMetadata", itemText:"PropertyMetadata", tailText:" (kotlin)" }
|
||||
// EXIST: { lookupString:"KProperty", itemText:"KProperty", tailText:"<R> (kotlin.reflect)" }
|
||||
+6
-6
@@ -2272,6 +2272,12 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("KProperty.kt")
|
||||
public void testKProperty() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/java/KProperty.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("NoDuplicationForImportedJavaClass.kt")
|
||||
public void testNoDuplicationForImportedJavaClass() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/java/NoDuplicationForImportedJavaClass.kt");
|
||||
@@ -2296,12 +2302,6 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PropertyMetadata.kt")
|
||||
public void testPropertyMetadata() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/java/PropertyMetadata.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("SAMAdaptersStatic.kt")
|
||||
public void testSAMAdaptersStatic() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/java/SAMAdaptersStatic.kt");
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<info>import</info> kotlin.reflect.KProperty
|
||||
|
||||
interface T
|
||||
class T1(<warning>t</warning>: Int): T
|
||||
|
||||
@@ -5,7 +7,7 @@ class T1(<warning>t</warning>: Int): T
|
||||
|
||||
|
||||
class Delegate(<warning>d</warning>: Int) {
|
||||
<info>operator</info> fun getValue(k: Any, m: PropertyMetadata) {}
|
||||
<info>operator</info> fun getValue(k: Any, m: KProperty<*>) {}
|
||||
}
|
||||
|
||||
class A(y: Int, t: Int, d: Int): T <info>by</info> T1(t) {
|
||||
|
||||
+5
-3
@@ -1,17 +1,19 @@
|
||||
// NO_ERRORS_DUMP
|
||||
package a
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
interface T
|
||||
|
||||
fun T.getValue(thisRef: B, desc: PropertyMetadata): Int {
|
||||
fun T.getValue(thisRef: B, desc: KProperty<*>): Int {
|
||||
return 3
|
||||
}
|
||||
|
||||
fun T.setValue(thisRef: B, desc: PropertyMetadata, value: Int) {
|
||||
fun T.setValue(thisRef: B, desc: KProperty<*>, value: Int) {
|
||||
}
|
||||
|
||||
class A(): T
|
||||
|
||||
<selection>class B {
|
||||
var v by A()
|
||||
}</selection>
|
||||
}</selection>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
fun foo() {
|
||||
a<caret>
|
||||
}
|
||||
@@ -5,7 +7,7 @@ fun foo() {
|
||||
val a by Delegate()
|
||||
|
||||
class Delegate {
|
||||
fun getValue(t: Any?, p: PropertyMetadata) = 1
|
||||
fun getValue(t: Any?, p: KProperty<*>) = 1
|
||||
}
|
||||
|
||||
// EXISTS: a.getValue(Any?\, PropertyMetadata)
|
||||
// EXISTS: a.getValue(Any?\, KProperty<*>)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
LineBreakpoint created at delegatedPropertyInClass.kt:8
|
||||
LineBreakpoint created at delegatedPropertyInClass.kt:9
|
||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! delegatedPropertyInClass.DelegatedPropertyInClassPackage
|
||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||
delegatedPropertyInClass.kt:8
|
||||
delegatedPropertyInClass.kt:9
|
||||
package delegatedPropertyInClass
|
||||
|
||||
import kotlin.properties.Delegates
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val a = A()
|
||||
@@ -18,23 +19,24 @@ class A {
|
||||
}
|
||||
|
||||
class MyDelegate {
|
||||
fun getValue(t: Any?, p: PropertyMetadata): Int = 1
|
||||
fun getValue(t: Any?, p: KProperty<*>): Int = 1
|
||||
}
|
||||
|
||||
class MyDelegateThrowsException {
|
||||
fun getValue(t: Any?, p: PropertyMetadata): Int = throw IllegalStateException()
|
||||
fun getValue(t: Any?, p: KProperty<*>): Int = throw IllegalStateException()
|
||||
}
|
||||
|
||||
// PRINT_FRAME
|
||||
frame = main():8, DelegatedPropertyInClassKt {delegatedPropertyInClass}
|
||||
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = delegatedPropertyInClass.kt, 5)
|
||||
local = a: delegatedPropertyInClass.A = {delegatedPropertyInClass.A@uniqueID} (sp = delegatedPropertyInClass.kt, 6)
|
||||
field = prop$delegate: delegatedPropertyInClass.MyDelegate = {delegatedPropertyInClass.MyDelegate@uniqueID} (sp = delegatedPropertyInClass.kt, 12)
|
||||
|
||||
frame = main():9, DelegatedPropertyInClassKt {delegatedPropertyInClass}
|
||||
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = delegatedPropertyInClass.kt, 6)
|
||||
local = a: delegatedPropertyInClass.A = {delegatedPropertyInClass.A@uniqueID} (sp = delegatedPropertyInClass.kt, 7)
|
||||
field = prop$delegate: delegatedPropertyInClass.MyDelegate = {delegatedPropertyInClass.MyDelegate@uniqueID} (sp = delegatedPropertyInClass.kt, 13)
|
||||
- Class has no fields
|
||||
field = prop: int = 1 (sp = delegatedPropertyInClass.kt, 12)
|
||||
field = propEx$delegate: delegatedPropertyInClass.MyDelegateThrowsException = {delegatedPropertyInClass.MyDelegateThrowsException@uniqueID} (sp = delegatedPropertyInClass.kt, 13)
|
||||
field = prop: int = 1 (sp = delegatedPropertyInClass.kt, 13)
|
||||
field = propEx$delegate: delegatedPropertyInClass.MyDelegateThrowsException = {delegatedPropertyInClass.MyDelegateThrowsException@uniqueID} (sp = delegatedPropertyInClass.kt, 14)
|
||||
- Class has no fields
|
||||
field = propEx: int = {java.lang.IllegalStateException@uniqueID}java.lang.IllegalStateException (sp = delegatedPropertyInClass.kt, 13)
|
||||
field = propEx: int = {java.lang.IllegalStateException@uniqueID}java.lang.IllegalStateException (sp = delegatedPropertyInClass.kt, 14)
|
||||
field = detailMessage: java.lang.String = null (sp = Throwable.!EXT!)
|
||||
field = cause: java.lang.Throwable = {java.lang.IllegalStateException@uniqueID}java.lang.IllegalStateException (sp = Throwable.!EXT!)
|
||||
field = stackTrace: java.lang.StackTraceElement[] = null (sp = Throwable.!EXT!)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
LineBreakpoint created at delegatedPropertyInClassWoRenderer.kt:8
|
||||
LineBreakpoint created at delegatedPropertyInClassWoRenderer.kt:9
|
||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! delegatedPropertyInClassWoRenderer.DelegatedPropertyInClassWoRendererPackage
|
||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||
delegatedPropertyInClassWoRenderer.kt:8
|
||||
delegatedPropertyInClassWoRenderer.kt:9
|
||||
package delegatedPropertyInClassWoRenderer
|
||||
|
||||
import kotlin.properties.Delegates
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val a = A()
|
||||
@@ -17,15 +18,16 @@ class A {
|
||||
}
|
||||
|
||||
class MyDelegate {
|
||||
fun getValue(t: Any?, p: PropertyMetadata): Int = 1
|
||||
fun getValue(t: Any?, p: KProperty<*>): Int = 1
|
||||
}
|
||||
|
||||
// RENDER_DELEGATED_PROPERTIES: false
|
||||
// PRINT_FRAME
|
||||
frame = main():8, DelegatedPropertyInClassWoRendererKt {delegatedPropertyInClassWoRenderer}
|
||||
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = delegatedPropertyInClassWoRenderer.kt, 5)
|
||||
local = a: delegatedPropertyInClassWoRenderer.A = {delegatedPropertyInClassWoRenderer.A@uniqueID} (sp = delegatedPropertyInClassWoRenderer.kt, 6)
|
||||
field = prop: int = {delegatedPropertyInClassWoRenderer.MyDelegate@uniqueID} (sp = delegatedPropertyInClassWoRenderer.kt, 12)
|
||||
|
||||
frame = main():9, DelegatedPropertyInClassWoRendererKt {delegatedPropertyInClassWoRenderer}
|
||||
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = delegatedPropertyInClassWoRenderer.kt, 6)
|
||||
local = a: delegatedPropertyInClassWoRenderer.A = {delegatedPropertyInClassWoRenderer.A@uniqueID} (sp = delegatedPropertyInClassWoRenderer.kt, 7)
|
||||
field = prop: int = {delegatedPropertyInClassWoRenderer.MyDelegate@uniqueID} (sp = delegatedPropertyInClassWoRenderer.kt, 13)
|
||||
- Class has no fields
|
||||
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
LineBreakpoint created at dependentOnFile.kt:5
|
||||
LineBreakpoint created at dependentOnFile.kt:7
|
||||
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! dependentOnFile.DependentOnFilePackage
|
||||
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||
dependentOnFile.kt:5
|
||||
dependentOnFile.kt:7
|
||||
Compile bytecode for TestClass().testFun()
|
||||
Compile bytecode for testFun()
|
||||
Compile bytecode for TestObject.p
|
||||
|
||||
+3
-1
@@ -1,5 +1,7 @@
|
||||
package dependentOnFile
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
//Breakpoint!
|
||||
args.size()
|
||||
@@ -25,7 +27,7 @@ val Int.testExtVal: Int get() = 1
|
||||
val testDelVal by Delegate()
|
||||
|
||||
class Delegate {
|
||||
fun getValue(a: Any?, b: PropertyMetadata) = 1
|
||||
fun getValue(a: Any?, b: KProperty<*>) = 1
|
||||
}
|
||||
|
||||
// EXPRESSION: TestClass().testFun()
|
||||
|
||||
Vendored
+4
-3
@@ -1,6 +1,7 @@
|
||||
package delegatedPropertyInClass
|
||||
|
||||
import kotlin.properties.Delegates
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val a = A()
|
||||
@@ -14,11 +15,11 @@ class A {
|
||||
}
|
||||
|
||||
class MyDelegate {
|
||||
fun getValue(t: Any?, p: PropertyMetadata): Int = 1
|
||||
fun getValue(t: Any?, p: KProperty<*>): Int = 1
|
||||
}
|
||||
|
||||
class MyDelegateThrowsException {
|
||||
fun getValue(t: Any?, p: PropertyMetadata): Int = throw IllegalStateException()
|
||||
fun getValue(t: Any?, p: KProperty<*>): Int = throw IllegalStateException()
|
||||
}
|
||||
|
||||
// PRINT_FRAME
|
||||
// PRINT_FRAME
|
||||
|
||||
+3
-2
@@ -1,6 +1,7 @@
|
||||
package delegatedPropertyInClassWoRenderer
|
||||
|
||||
import kotlin.properties.Delegates
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val a = A()
|
||||
@@ -13,8 +14,8 @@ class A {
|
||||
}
|
||||
|
||||
class MyDelegate {
|
||||
fun getValue(t: Any?, p: PropertyMetadata): Int = 1
|
||||
fun getValue(t: Any?, p: KProperty<*>): Int = 1
|
||||
}
|
||||
|
||||
// RENDER_DELEGATED_PROPERTIES: false
|
||||
// PRINT_FRAME
|
||||
// PRINT_FRAME
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
// PSI_ELEMENT: org.jetbrains.kotlin.psi.JetNamedFunction
|
||||
// OPTIONS: usages
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class Delegate() {
|
||||
fun <caret>getValue(thisRef: Any?, propertyMetadata: PropertyMetadata): String = ":)"
|
||||
fun <caret>getValue(thisRef: Any?, property: KProperty<*>): String = ":)"
|
||||
}
|
||||
|
||||
val p: String by Delegate()
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
Property delegation (8: 15) val p: String by Delegate()
|
||||
Property delegation (10: 15) val p: String by Delegate()
|
||||
@@ -1,12 +1,14 @@
|
||||
// PSI_ELEMENT: org.jetbrains.kotlin.psi.JetNamedFunction
|
||||
// OPTIONS: usages
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class Delegate() {
|
||||
fun getValue(thisRef: Any?, propertyMetadata: PropertyMetadata): String = ":)"
|
||||
fun setValue(thisRef: Any?, propertyMetadata: PropertyMetadata, value: String) {
|
||||
fun getValue(thisRef: Any?, property: KProperty<*>): String = ":)"
|
||||
fun setValue(thisRef: Any?, property: KProperty<*>, value: String) {
|
||||
}
|
||||
|
||||
fun <caret>propertyDelegated(propertyMetadata: PropertyMetadata) {
|
||||
fun <caret>propertyDelegated(property: KProperty<*>) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
Property delegation (13: 15) var p: String by Delegate()
|
||||
Property delegation (15: 15) var p: String by Delegate()
|
||||
@@ -1,9 +1,11 @@
|
||||
// PSI_ELEMENT: org.jetbrains.kotlin.psi.JetNamedFunction
|
||||
// OPTIONS: usages
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class Delegate() {
|
||||
fun getValue(thisRef: Any?, propertyMetadata: PropertyMetadata): String = ":)"
|
||||
fun <caret>setValue(thisRef: Any?, propertyMetadata: PropertyMetadata, value: String) {
|
||||
fun getValue(thisRef: Any?, property: KProperty<*>): String = ":)"
|
||||
fun <caret>setValue(thisRef: Any?, property: KProperty<*>, value: String) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
Property delegation (11: 15) var p: String by Delegate()
|
||||
Property delegation (13: 15) var p: String by Delegate()
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
import pack.bar
|
||||
import pack.oldFun2 // should not be removed for non-deprecated overload used
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A private constructor()
|
||||
|
||||
@@ -45,8 +46,8 @@ class Foo {
|
||||
}
|
||||
|
||||
class CustomDelegate {
|
||||
operator fun getValue(thisRef: Any?, prop: PropertyMetadata): String = ""
|
||||
operator fun setValue(thisRef: Any?, prop: PropertyMetadata, value: String) {}
|
||||
operator fun getValue(thisRef: Any?, prop: KProperty<*>): String = ""
|
||||
operator fun setValue(thisRef: Any?, prop: KProperty<*>, value: String) {}
|
||||
}
|
||||
|
||||
class B {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class MyProperty {
|
||||
fun getValue(thisRef: Any?, desc: PropertyMetadata) = ":)"
|
||||
fun getValue(thisRef: Any?, desc: KProperty<*>) = ":)"
|
||||
}
|
||||
|
||||
val Any.ext by MyProperty()
|
||||
|
||||
+2
-2
@@ -9,5 +9,5 @@ class B {
|
||||
}
|
||||
|
||||
// MULTIRESOLVE
|
||||
// REF: (for T in dependency).getValue(R,kotlin.PropertyMetadata)
|
||||
// REF: (for T in dependency).setValue(R,kotlin.PropertyMetadata,kotlin.Int)
|
||||
// REF: (for T in dependency).getValue(R,kotlin.reflect.KProperty<*>)
|
||||
// REF: (for T in dependency).setValue(R,kotlin.reflect.KProperty<*>,kotlin.Int)
|
||||
|
||||
+4
-2
@@ -1,8 +1,10 @@
|
||||
package dependency
|
||||
|
||||
public fun <T, R> T.getValue(thisRef: R, desc: PropertyMetadata): Int {
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
public fun <T, R> T.getValue(thisRef: R, desc: KProperty<*>): Int {
|
||||
return 3
|
||||
}
|
||||
|
||||
public fun <T, R> T.setValue(thisRef: R, desc: PropertyMetadata, value: Int) {
|
||||
public fun <T, R> T.setValue(thisRef: R, desc: KProperty<*>, value: Int) {
|
||||
}
|
||||
|
||||
+6
-4
@@ -1,16 +1,18 @@
|
||||
package foo.bar
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
/*p:foo.bar*/class D1 {
|
||||
fun get(t: /*c:foo.bar.D1 p:foo.bar*/Any?, p: /*c:foo.bar.D1 p:foo.bar*/PropertyMetadata) = 1
|
||||
fun get(t: /*c:foo.bar.D1 p:foo.bar*/Any?, p: /*c:foo.bar.D1*/KProperty<*>) = 1
|
||||
}
|
||||
|
||||
/*p:foo.bar*/fun /*p:foo.bar*/D1.set(t: /*p:foo.bar*/Any?, p: /*p:foo.bar*/PropertyMetadata, v: /*p:foo.bar*/Int) {}
|
||||
/*p:foo.bar*/fun /*p:foo.bar*/D1.set(t: /*p:foo.bar*/Any?, p: KProperty<*>, v: /*p:foo.bar*/Int) {}
|
||||
|
||||
/*p:foo.bar(D2)*/open class D2 {
|
||||
fun set(t: /*c:foo.bar.D2 p:foo.bar*/Any?, p: /*c:foo.bar.D2 p:foo.bar*/PropertyMetadata, v: /*c:foo.bar.D2 p:foo.bar*/Int) {}
|
||||
fun set(t: /*c:foo.bar.D2 p:foo.bar*/Any?, p: /*c:foo.bar.D2*/KProperty<*>, v: /*c:foo.bar.D2 p:foo.bar*/Int) {}
|
||||
}
|
||||
|
||||
/*p:foo.bar*/fun /*p:foo.bar*/D2.get(t: /*p:foo.bar*/Any?, p: /*p:foo.bar*/PropertyMetadata) = 1
|
||||
/*p:foo.bar*/fun /*p:foo.bar*/D2.get(t: /*p:foo.bar*/Any?, p: KProperty<*>) = 1
|
||||
/*p:foo.bar*/fun /*p:foo.bar*/D2.propertyDelegated(p: /*p:foo.bar*/Any?) {}
|
||||
|
||||
/*p:foo.bar*/class D3 : /*p:foo.bar*/D2() {
|
||||
|
||||
Vendored
+3
@@ -7,7 +7,9 @@ Compiling files:
|
||||
src/inlineGet.kt
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module/usage/UsageVal$x$1.class
|
||||
out/production/module/usage/UsageVal.class
|
||||
out/production/module/usage/UsageVar$x$1.class
|
||||
out/production/module/usage/UsageVar.class
|
||||
End of files
|
||||
Compiling files:
|
||||
@@ -25,6 +27,7 @@ Compiling files:
|
||||
src/inlineSet.kt
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module/usage/UsageVar$x$1.class
|
||||
out/production/module/usage/UsageVar.class
|
||||
End of files
|
||||
Compiling files:
|
||||
|
||||
Vendored
+4
-2
@@ -1,5 +1,7 @@
|
||||
package inline
|
||||
|
||||
inline fun Inline.getValue(receiver: Any?, prop: PropertyMetadata): Int {
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
inline fun Inline.getValue(receiver: Any?, prop: KProperty<*>): Int {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -1,5 +1,7 @@
|
||||
package inline
|
||||
|
||||
inline fun Inline.getValue(receiver: Any?, prop: PropertyMetadata): Int {
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
inline fun Inline.getValue(receiver: Any?, prop: KProperty<*>): Int {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+4
-2
@@ -1,5 +1,7 @@
|
||||
package inline
|
||||
|
||||
inline fun Inline.setValue(receiver: Any?, prop: PropertyMetadata, value: Int) {
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
inline fun Inline.setValue(receiver: Any?, prop: KProperty<*>, value: Int) {
|
||||
println(value)
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -1,5 +1,7 @@
|
||||
package inline
|
||||
|
||||
inline fun Inline.setValue(receiver: Any?, prop: PropertyMetadata, value: Int) {
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
inline fun Inline.setValue(receiver: Any?, prop: KProperty<*>, value: Int) {
|
||||
println(value * 2)
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -5,7 +5,9 @@ Compiling files:
|
||||
src/inline.kt
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module/usage/UsageVal$x$1.class
|
||||
out/production/module/usage/UsageVal.class
|
||||
out/production/module/usage/UsageVar$x$1.class
|
||||
out/production/module/usage/UsageVar.class
|
||||
End of files
|
||||
Compiling files:
|
||||
@@ -21,6 +23,7 @@ Compiling files:
|
||||
src/inline.kt
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module/usage/UsageVar$x$1.class
|
||||
out/production/module/usage/UsageVar.class
|
||||
End of files
|
||||
Compiling files:
|
||||
|
||||
+5
-3
@@ -1,11 +1,13 @@
|
||||
package inline
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class Inline {
|
||||
inline fun getValue(receiver: Any?, prop: PropertyMetadata): Int {
|
||||
inline fun getValue(receiver: Any?, prop: KProperty<*>): Int {
|
||||
return 0
|
||||
}
|
||||
|
||||
inline fun setValue(receiver: Any?, prop: PropertyMetadata, value: Int) {
|
||||
inline fun setValue(receiver: Any?, prop: KProperty<*>, value: Int) {
|
||||
println(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+5
-3
@@ -1,11 +1,13 @@
|
||||
package inline
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class Inline {
|
||||
inline fun getValue(receiver: Any?, prop: PropertyMetadata): Int {
|
||||
inline fun getValue(receiver: Any?, prop: KProperty<*>): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
inline fun setValue(receiver: Any?, prop: PropertyMetadata, value: Int) {
|
||||
inline fun setValue(receiver: Any?, prop: KProperty<*>, value: Int) {
|
||||
println(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+5
-3
@@ -1,11 +1,13 @@
|
||||
package inline
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class Inline {
|
||||
inline fun getValue(receiver: Any?, prop: PropertyMetadata): Int {
|
||||
inline fun getValue(receiver: Any?, prop: KProperty<*>): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
inline fun setValue(receiver: Any?, prop: PropertyMetadata, value: Int) {
|
||||
inline fun setValue(receiver: Any?, prop: KProperty<*>, value: Int) {
|
||||
println(value * 2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user