Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed

This commit is contained in:
Mikhail Glukhikh
2020-03-04 17:54:33 +03:00
parent 186e0b0cba
commit 8884cbe415
2268 changed files with 1175 additions and 19754 deletions
@@ -1,8 +0,0 @@
// http://youtrack.jetbrains.net/issue/KT-552
// KT-552 For variable unresolved if loop body is not block
fun ff() {
var i = 1
for (j in 1..10)
i += j
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// http://youtrack.jetbrains.net/issue/KT-552
// KT-552 For variable unresolved if loop body is not block
@@ -1,30 +0,0 @@
// KT-6774 Cannot find equals() when comparing with null
fun <T: Any> fn(t1: T, t2: T?) {
val x = if (true) t1 else t2
x == null
x?.equals(null)
x?.hashCode()
x.toString()
x!!.hashCode()
val y = t2 ?: t1
y == t1
y.equals(null)
y.hashCode()
y.toString()
y.hashCode()
}
interface Tr {
fun foo()
}
fun <T: Tr> fn(t1: T, t2: T?) {
val x = if (true) t1 else t2
x?.foo()
x!!.foo()
val y = t2 ?: t1
y.foo()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// KT-6774 Cannot find equals() when comparing with null
fun <T: Any> fn(t1: T, t2: T?) {
@@ -1,20 +0,0 @@
val ns: String? = null
val testElvis1: String? = ns ?: ""
val testElvis2: String = run { ns ?: "" }
val testElvis3: String? = run { ns ?: "" }
val testIf1: String? = if (true) "" else ""
val testIf2: String? = run { if (true) "" else "" }
val testIf3: String? = if (true) run { "" } else ""
val testIf4: String? = run { run { if (true) "" else "" } }
val testIf5: String? = run { if (true) run { "" } else "" }
val testWhen1: String? = when { else -> "" }
val testWhen2: String? = run { when { else -> "" } }
val testWhen3: String? = when { else -> run { "" } }
val testWhen4: String? = run { run { when { else -> "" } } }
val testWhen5: String? = run { when { else -> run { "" } } }
val testExcl1: String? = run { ns!! }
val testExcl2: String? = run { run { ns!! } }
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
val ns: String? = null
val testElvis1: String? = ns ?: ""