Fix language features in tests for gradual migration to 1.3 (part 2)

In 1.3, due to changes in language, testdata for some tests can be
different from 1.2

We want to simlultaneously test both versions, so instead of fixing
language version in such tests, we split them into two: one with fixed
1.2, another with fixed 1.3
This commit is contained in:
Dmitry Savvinov
2018-06-22 11:23:52 +03:00
parent 6d733ff7b9
commit 5cb949ad7f
71 changed files with 1637 additions and 99 deletions
@@ -0,0 +1,23 @@
// !LANGUAGE: +RestrictionOfValReassignmentViaBackingField
package a
import java.util.HashSet
val a: MutableSet<String>? = null
get() {
if (a == null) {
<!VAL_REASSIGNMENT_VIA_BACKING_FIELD_ERROR!>field<!> = HashSet()
}
return a
}
class R {
val b: String? = null
get() {
if (b == null) {
<!VAL_REASSIGNMENT_VIA_BACKING_FIELD_ERROR!>field<!> = "b"
}
return b
}
}
@@ -1,3 +1,5 @@
// !LANGUAGE: -RestrictionOfValReassignmentViaBackingField
package a
import java.util.HashSet
@@ -19,4 +21,3 @@ class R {
return b
}
}
@@ -0,0 +1,13 @@
package
package a {
public val a: kotlin.collections.MutableSet<kotlin.String>? = null
public final class R {
public constructor R()
public final val b: kotlin.String? = null
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
@@ -0,0 +1,18 @@
// !LANGUAGE: +ReadDeserializedContracts +UseCallsInPlaceEffect
// See KT-17479
class Test {
val str: String
init {
run {
this@Test.str = "A"
}
run {
// Not sure do we need diagnostic also here
<!VAL_REASSIGNMENT!>this@Test.str<!> = "B"
}
str = "C"
}
}
@@ -1,3 +1,4 @@
// !LANGUAGE: -ReadDeserializedContracts -UseCallsInPlaceEffect
// See KT-17479
class Test {
@@ -0,0 +1,9 @@
package
public final class Test {
public constructor Test()
public final val str: kotlin.String
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}