Switch kotlin version to 1.7

* Change 1.6 to 1.7 constants
* Fix SAFE_CALL_WILL_CHANGE_NULLABILITY for testData
* Change EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_WARNING to EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR
* Change NON_EXHAUSTIVE_WHEN_STATEMENT to NO_ELSE_IN_WHEN
* Fix testData for SafeCallsAreAlwaysNullable
* Change T -> T & Any in test dumps
* Change INVALID_CHARACTERS_NATIVE_WARNING -> INVALID_CHARACTERS_NATIVE_ERROR
* TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_WARNING -> TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR
This commit is contained in:
Mikhail Glukhikh
2021-12-23 17:55:36 +03:00
committed by Space
parent d741aaf82f
commit 53d6ac24e5
269 changed files with 624 additions and 1132 deletions
@@ -16,7 +16,7 @@ fun test(ordinal: Int) {
buildString {
insert(KDocTemplate()) {
definition {
<!SAFE_CALL_WILL_CHANGE_NULLABILITY!>ordinal<!UNNECESSARY_SAFE_CALL!>?.<!>let {}<!>
ordinal<!UNNECESSARY_SAFE_CALL!>?.<!>let {}
}
}
}
@@ -27,7 +27,7 @@ fun test_2(cond: Boolean?) {
}
fun test_3(cond: Boolean) {
<!NON_EXHAUSTIVE_WHEN_STATEMENT!>when<!> (cond) {
<!NO_ELSE_IN_WHEN!>when<!> (cond) {
true -> 1
}
}
@@ -27,7 +27,7 @@ fun test_2(enum: SomeEnum?) {
}
fun test_3(enum: SomeEnum) {
<!NON_EXHAUSTIVE_WHEN_STATEMENT!>when<!> (enum) {
<!NO_ELSE_IN_WHEN!>when<!> (enum) {
SomeEnum.A -> 1
}
}
@@ -44,7 +44,7 @@ fun test_2(base: Base?) {
}
fun test_3(base: Base) {
<!NON_EXHAUSTIVE_WHEN_STATEMENT!>when<!> (base) {
<!NO_ELSE_IN_WHEN!>when<!> (base) {
is A -> 1
}
}
@@ -17,4 +17,4 @@ class A {
open class Test
inline class ExtendTest(val x: Int): <!SUPERTYPE_NOT_INITIALIZED, VALUE_CLASS_CANNOT_EXTEND_CLASSES!>Test<!>
inline class ImplementByDelegation(val x: Int) : <!VALUE_CLASS_CANNOT_IMPLEMENT_INTERFACE_BY_DELEGATION!>Comparable<Int><!> by x
inline class ImplementByDelegation(val x: Int) : Comparable<Int> by x
@@ -69,8 +69,8 @@ fun test_6(d1: D) {
}
fun test_7(d1: D, d2: D) {
val a = <!SAFE_CALL_WILL_CHANGE_NULLABILITY!>d1<!UNNECESSARY_SAFE_CALL!>?.<!>any<!>
val b = <!SAFE_CALL_WILL_CHANGE_NULLABILITY!>d2<!UNNECESSARY_SAFE_CALL!>?.<!>any<!>
val a = d1<!UNNECESSARY_SAFE_CALL!>?.<!>any
val b = d2<!UNNECESSARY_SAFE_CALL!>?.<!>any
a as A
a.foo() // should be OK
b as B
@@ -8,7 +8,7 @@ typealias TA = A<CharSequence>
fun bar(): TA = TODO()
fun foo() {
<!NON_EXHAUSTIVE_WHEN_STATEMENT!>when<!> (val a = bar()) {
<!NO_ELSE_IN_WHEN!>when<!> (val a = bar()) {
is A.B -> a.x.length
}
}