Merge pull request #621 from JetBrains/rr/yole/kt4142
Regression tests for some more obsolete issues in the JVM backend
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
open class B {
|
||||
val name: String
|
||||
get() = "OK"
|
||||
}
|
||||
|
||||
trait A {
|
||||
val name: String
|
||||
}
|
||||
|
||||
class C : B(), A {
|
||||
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return C().name
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
fun box(): String {
|
||||
val s: String? = "a"
|
||||
val o: Char? = s?.charAt(0)
|
||||
val c: Any? = o?.javaClass
|
||||
return if (c != null) "OK" else "fail"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class D {
|
||||
companion object {
|
||||
protected val F: String = "OK"
|
||||
}
|
||||
|
||||
inner class E {
|
||||
fun foo() = F
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return D().E().foo()
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fun box(): String {
|
||||
val res = (1..3).map { it ->
|
||||
if (it == 1)
|
||||
2
|
||||
};
|
||||
|
||||
var result = ""
|
||||
for (i in res)
|
||||
result += " "
|
||||
return if (result == " ") "OK" else result
|
||||
}
|
||||
Reference in New Issue
Block a user