mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Fix for KT-9939: java.lang.VerifyError: Bad type on operand stack for Boolean convenience accessor
#KT-9939 Fixed
This commit is contained in:
12
compiler/testData/codegen/boxWithJava/javaProperty/boxedGetter/JavaClass.java
vendored
Normal file
12
compiler/testData/codegen/boxWithJava/javaProperty/boxedGetter/JavaClass.java
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
public class JavaClass {
|
||||
|
||||
private Boolean value;
|
||||
|
||||
public Boolean isValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(boolean value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
13
compiler/testData/codegen/boxWithJava/javaProperty/boxedGetter/kotlin.kt
vendored
Normal file
13
compiler/testData/codegen/boxWithJava/javaProperty/boxedGetter/kotlin.kt
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
fun box(): String {
|
||||
val javaClass = JavaClass()
|
||||
|
||||
if (javaClass.isValue != null) return "fail 1"
|
||||
|
||||
javaClass.isValue = false
|
||||
if (javaClass.isValue != false) return "fail 2"
|
||||
|
||||
javaClass.isValue = true
|
||||
if (javaClass.isValue != true) return "fail 3"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
12
compiler/testData/codegen/boxWithJava/javaProperty/boxedSetter/JavaClass.java
vendored
Normal file
12
compiler/testData/codegen/boxWithJava/javaProperty/boxedSetter/JavaClass.java
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
public class JavaClass {
|
||||
|
||||
private boolean value;
|
||||
|
||||
public boolean isValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Boolean value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
11
compiler/testData/codegen/boxWithJava/javaProperty/boxedSetter/kotlin.kt
vendored
Normal file
11
compiler/testData/codegen/boxWithJava/javaProperty/boxedSetter/kotlin.kt
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fun box(): String {
|
||||
val javaClass = JavaClass()
|
||||
|
||||
if (javaClass.isValue != false) return "fail 1"
|
||||
|
||||
javaClass.isValue = true
|
||||
|
||||
if (javaClass.isValue != true) return "fail 2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user