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,15 +0,0 @@
// !LANGUAGE: -ProperForInArrayLoopRangeVariableAssignmentSemantic
// !DIAGNOSTICS: -UNUSED_VALUE
// SKIP_TXT
var xs: IntArray = intArrayOf(1, 2, 3)
get() = field
set(ys) {
var sum = 0
for (x in field) {
sum = sum * 10 + x
field = intArrayOf(4, 5, 6)
}
if (sum != 123) throw AssertionError("sum=$sum")
field = ys
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: -ProperForInArrayLoopRangeVariableAssignmentSemantic
// !DIAGNOSTICS: -UNUSED_VALUE
// SKIP_TXT
@@ -1,16 +0,0 @@
// !LANGUAGE: -ProperForInArrayLoopRangeVariableAssignmentSemantic
// !DIAGNOSTICS: -UNUSED_VALUE
// SKIP_TXT
class Delegate<T>(var v: T) {
operator fun getValue(thisRef: Any?, kProp: Any?) = v
operator fun setValue(thisRef: Any?, kProp: Any?, value: T) { v = value }
}
fun testLocalDelegatedProperty() {
var xs by Delegate(arrayOf("a", "b", "c"))
for (x in xs) {
println(x)
xs = arrayOf("d", "e", "f")
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: -ProperForInArrayLoopRangeVariableAssignmentSemantic
// !DIAGNOSTICS: -UNUSED_VALUE
// SKIP_TXT
@@ -1,19 +0,0 @@
// !LANGUAGE: +ProperForInArrayLoopRangeVariableAssignmentSemantic
// !DIAGNOSTICS: -UNUSED_VALUE
// SKIP_TXT
fun testObjectArray() {
var xs = arrayOf("a", "b", "c")
for (x in xs) {
println(x)
xs = arrayOf("d", "e", "f")
}
}
fun testPrimitiveArray() {
var xs = intArrayOf(1, 2, 3)
for (x in xs) {
println(x)
xs = intArrayOf(4, 5, 6)
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +ProperForInArrayLoopRangeVariableAssignmentSemantic
// !DIAGNOSTICS: -UNUSED_VALUE
// SKIP_TXT