KT-18786: J2K should move all properties to top of class
#KT-18786 fixed
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
// ERROR: Type mismatch: inferred type is String? but String was expected
|
||||
class TestJava {
|
||||
fun nullableObj(p: Int): Any? {
|
||||
return if (p > 0) "response" else null
|
||||
}
|
||||
|
||||
var nullableInitializerFieldCast: String = nullableObj(3) as String?
|
||||
private val nullableInitializerPrivateFieldCast = nullableObj(3) as String?
|
||||
fun nullableObj(p: Int): Any? {
|
||||
return if (p > 0) "response" else null
|
||||
}
|
||||
|
||||
fun testProperty() {
|
||||
nullableInitializerFieldCast[0]
|
||||
|
||||
Reference in New Issue
Block a user