KT-10631 Consider creating a synthetic property even when the setter returns 'this'
#KT-10631 Fixed
This commit is contained in:
+5
-9
@@ -4,8 +4,7 @@ fun foo(javaClass: JavaClass) {
|
||||
<!VAL_REASSIGNMENT!>javaClass.something2<!>++
|
||||
<!VAL_REASSIGNMENT!>javaClass.something3<!>++
|
||||
<!VAL_REASSIGNMENT!>javaClass.something4<!>++
|
||||
<!VAL_REASSIGNMENT!>javaClass.something5<!>++
|
||||
<!VAL_REASSIGNMENT!>javaClass.something6<!> = null
|
||||
<!VAL_REASSIGNMENT!>javaClass.something5<!> = null
|
||||
}
|
||||
|
||||
// FILE: JavaClass.java
|
||||
@@ -17,14 +16,11 @@ public class JavaClass {
|
||||
public void setSomething2(String value) { }
|
||||
|
||||
public int getSomething3() { return 1; }
|
||||
public int setSomething3(int value) { return value; }
|
||||
public <T> void setSomething3(int value) { return value; }
|
||||
|
||||
public int getSomething4() { return 1; }
|
||||
public <T> void setSomething4(int value) { return value; }
|
||||
public static void setSomething4(int value) { }
|
||||
|
||||
public int getSomething5() { return 1; }
|
||||
public static void setSomething5(int value) { }
|
||||
|
||||
public int[] getSomething6() { return null; }
|
||||
public void setSomething6(int... value) { }
|
||||
public int[] getSomething5() { return null; }
|
||||
public void setSomething5(int... value) { }
|
||||
}
|
||||
+4
-6
@@ -9,16 +9,14 @@ public open class JavaClass {
|
||||
public open fun getSomething2(): kotlin.Int
|
||||
public open fun getSomething3(): kotlin.Int
|
||||
public open fun getSomething4(): kotlin.Int
|
||||
public open fun getSomething5(): kotlin.Int
|
||||
public open fun getSomething6(): kotlin.IntArray!
|
||||
public open fun getSomething5(): kotlin.IntArray!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open fun setSomething1(/*0*/ value: kotlin.Int, /*1*/ c: kotlin.Char): kotlin.Unit
|
||||
public open fun setSomething2(/*0*/ value: kotlin.String!): kotlin.Unit
|
||||
public open fun setSomething3(/*0*/ value: kotlin.Int): kotlin.Int
|
||||
public open fun </*0*/ T : kotlin.Any!> setSomething4(/*0*/ value: kotlin.Int): kotlin.Unit
|
||||
public open fun setSomething6(/*0*/ vararg value: kotlin.Int /*kotlin.IntArray!*/): kotlin.Unit
|
||||
public open fun </*0*/ T : kotlin.Any!> setSomething3(/*0*/ value: kotlin.Int): kotlin.Unit
|
||||
public open fun setSomething5(/*0*/ vararg value: kotlin.Int /*kotlin.IntArray!*/): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public open fun setSomething5(/*0*/ value: kotlin.Int): kotlin.Unit
|
||||
public open fun setSomething4(/*0*/ value: kotlin.Int): kotlin.Unit
|
||||
}
|
||||
|
||||
+7
-3
@@ -1,10 +1,14 @@
|
||||
// FILE: KotlinFile.kt
|
||||
fun foo(javaClass: JavaClass) {
|
||||
javaClass.something++
|
||||
javaClass.something1++
|
||||
javaClass.something2++
|
||||
}
|
||||
|
||||
// FILE: JavaClass.java
|
||||
public class JavaClass {
|
||||
public int getSomething() { return 1; }
|
||||
public void setSomething(int value) { }
|
||||
public int getSomething1() { return 1; }
|
||||
public void setSomething1(int value) { }
|
||||
|
||||
public int getSomething2() { return 1; }
|
||||
public JavaClass setSomething2(int value) { return this; }
|
||||
}
|
||||
+4
-2
@@ -5,8 +5,10 @@ public fun foo(/*0*/ javaClass: JavaClass): kotlin.Unit
|
||||
public open class JavaClass {
|
||||
public constructor JavaClass()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun getSomething(): kotlin.Int
|
||||
public open fun getSomething1(): kotlin.Int
|
||||
public open fun getSomething2(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open fun setSomething(/*0*/ value: kotlin.Int): kotlin.Unit
|
||||
public open fun setSomething1(/*0*/ value: kotlin.Int): kotlin.Unit
|
||||
public open fun setSomething2(/*0*/ value: kotlin.Int): JavaClass!
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user