[FIR] Fix synthetic property is not var due to Nullable on parameter
Synthetic property is var when it have setter. The latter is set up in property when its parameter type is equal to getter return type. In case of using @Nullable, parameter type of setter is not equal to return type of getter, because the latter is flexible type. So to fix this verification should occur using not null types #KT-39076 Fixed
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// FILE: JavaClass.java
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class JavaClass {
|
||||
private String myFoo = "";
|
||||
public String getFoo() { return myFoo; }
|
||||
public void setFoo(@Nullable String s) { myFoo = s; }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
fun main(j: JavaClass) {
|
||||
j.foo += "OK"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
FILE: main.kt
|
||||
public final fun main(j: R|JavaClass|): R|kotlin/Unit| {
|
||||
R|<local>/j|.R|/JavaClass.foo| = R|<local>/j|.R|/JavaClass.foo|.R|kotlin/String.plus|(String(OK))
|
||||
}
|
||||
Reference in New Issue
Block a user