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
@@ -41,6 +41,7 @@ fun getSequence(a: Foo) =
Foo.E-> {
yield("E")
}
else -> {}
}
yield("end")
}
@@ -1,4 +1,4 @@
class MyObject private constructor(val delegate: Interface) : Interface by delegate {
class MyObject private constructor(private val delegate: Interface) : Interface by delegate {
constructor() : this(Delegate())
}
@@ -8,7 +8,7 @@ class Delegate : Interface {
}
}
private interface Interface {
interface Interface {
fun greet(): String
}
@@ -1,8 +1,6 @@
// WITH_STDLIB
// CHECK_BYTECODE_LISTING
// IGNORE_BACKEND: JS, JS_IR, WASM, NATIVE
// TODO: Fir2Ir generates overrides as finals.
// IGNORE_BACKEND_FIR: JVM_IR
@JvmInline
value class Inlined(val value: Int)
@@ -1,48 +0,0 @@
@kotlin.Metadata
public interface A {
// source: 'overrideReturnNothing.kt'
public abstract @org.jetbrains.annotations.Nullable method foo-wSRmS7I(): Inlined
public abstract method foo2-yXoPhBc(): int
public abstract @org.jetbrains.annotations.Nullable method getProperty-wSRmS7I(): Inlined
public abstract method getProperty2-yXoPhBc(): int
}
@kotlin.Metadata
public final class B {
// source: 'overrideReturnNothing.kt'
private final @org.jetbrains.annotations.Nullable field property: java.lang.Void
public method <init>(): void
public @org.jetbrains.annotations.Nullable method foo(): java.lang.Void
public synthetic bridge method foo-wSRmS7I(): Inlined
public @org.jetbrains.annotations.NotNull method foo2(): java.lang.Void
public synthetic bridge method foo2-yXoPhBc(): int
public @org.jetbrains.annotations.Nullable method getProperty(): java.lang.Void
public synthetic bridge method getProperty-wSRmS7I(): Inlined
public @org.jetbrains.annotations.NotNull method getProperty2(): java.lang.Void
public synthetic bridge method getProperty2-yXoPhBc(): int
}
@kotlin.jvm.JvmInline
@kotlin.Metadata
public final class Inlined {
// source: 'overrideReturnNothing.kt'
private final field value: int
private synthetic method <init>(p0: int): void
public synthetic final static method box-impl(p0: int): Inlined
public static method constructor-impl(p0: int): int
public method equals(p0: java.lang.Object): boolean
public static method equals-impl(p0: int, p1: java.lang.Object): boolean
public final static method equals-impl0(p0: int, p1: int): boolean
public final method getValue(): int
public method hashCode(): int
public static method hashCode-impl(p0: int): int
public method toString(): java.lang.String
public static method toString-impl(p0: int): java.lang.String
public synthetic final method unbox-impl(): int
}
@kotlin.Metadata
public final class OverrideReturnNothingKt {
// source: 'overrideReturnNothing.kt'
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
}
@@ -1,5 +1,7 @@
// !LANGUAGE: +StrictJavaNullabilityAssertions -ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: expected: <OK> but was: <Fail: SHOULD NOT throw>, issue related to T & Any
// See KT-8135
// We could generate runtime assertion on call site for 'generic<NOT_NULL_TYPE>()' below.
+1 -1
View File
@@ -2,6 +2,6 @@ enum class A { X1, X2 }
fun box(): String {
when {}
when (A.X1) {}
when (A.X1) { else -> {} }
return "OK"
}
@@ -15,10 +15,8 @@ fun bar1(x : BigEnum) : String {
when (x) {
BigEnum.ITEM1, BigEnum.ITEM2, BigEnum.ITEM3 -> return "123"
BigEnum.ITEM4, BigEnum.ITEM5, BigEnum.ITEM6 -> return "456"
else -> return "-1";
}
return "-1";
}
fun bar2(x : BigEnum) : String {
@@ -20,9 +20,8 @@ class A {
Season.WINTER, Season.SPRING -> return "winter_spring"
Season.SPRING -> return "spring"
Season.SUMMER -> return "summer"
else -> return "autumn";
}
return "autumn";
}
public fun bar2(y : Season) : String {
@@ -21,18 +21,16 @@ fun foo1(x : Season?) : String {
when(x) {
Season.AUTUMN, Season.SPRING -> return "autumn_or_spring";
Season.SUMMER, null -> return "summer_or_null"
else -> return "other"
}
return "other"
}
fun foo2(x : Season?) : String {
when(x) {
Season.AUTUMN, Season.SPRING -> return "autumn_or_spring";
Season.SUMMER -> return "summer"
else -> return "other"
}
return "other"
}
fun box() : String {
@@ -20,8 +20,8 @@ fun bar1(x : Season) : String {
Season.WINTER, Season.SPRING -> return "winter_spring"
Season.SPRING -> return "spring"
Season.SUMMER -> return "summer"
else -> return "autumn"
}
return "autumn"
}
fun bar2(x : Season) : String {
@@ -30,9 +30,8 @@ fun bar2(x : Season) : String {
Season.SPRING -> return "spring"
Season.SUMMER -> return "summer"
Season.AUTUMN -> return "autumn"
else -> return "fail unknown"
}
return "fail unknown"
}
fun box() : String {
@@ -14,18 +14,16 @@ fun foo1(x : Season?) : String {
when(val xx = x) {
Season.AUTUMN, Season.SPRING -> return "autumn_or_spring $xx";
Season.SUMMER, null -> return "summer_or_null $xx"
else -> return "other"
}
return "other"
}
fun foo2(x : Season?) : String {
when(val xx = x) {
Season.AUTUMN, Season.SPRING -> return "autumn_or_spring $xx";
Season.SUMMER -> return "summer"
else -> return "other"
}
return "other"
}
fun box() : String {
@@ -3,4 +3,4 @@ fun test(s: String) = s?.length
// 0 IFNULL
// 0 IFNONNULL
// 0 intValue
// 0 valueOf
// 1 valueOf
@@ -9,10 +9,8 @@ fun bar1(x : BigEnum) : String {
when (x) {
BigEnum.ITEM1, BigEnum.ITEM2, BigEnum.ITEM3 -> return "123"
BigEnum.ITEM4, BigEnum.ITEM5, BigEnum.ITEM6 -> return "456"
else -> return "-1"
}
return "-1";
}
fun bar2(x : BigEnum) : String {
@@ -13,9 +13,8 @@ class A {
Season.WINTER, Season.SPRING -> return "winter_spring"
Season.SPRING -> return "spring"
Season.SUMMER -> return "summer"
else -> return "autumn"
}
return "autumn";
}
public fun bar2(y : Season) : String {
@@ -9,18 +9,16 @@ fun foo1(x : Season?) : String {
when(x) {
Season.AUTUMN, Season.SPRING -> return "autumn_or_spring";
Season.SUMMER, null -> return "summer_or_null"
else -> return "other"
}
return "other"
}
fun foo2(x : Season?) : String {
when(x) {
Season.AUTUMN, Season.SPRING -> return "autumn_or_spring";
Season.SUMMER -> return "summer"
else -> return "other"
}
return "other"
}
// 2 TABLESWITCH
@@ -12,8 +12,8 @@ fun bar1(x : Season) : String {
Season.WINTER, Season.SPRING -> return "winter_spring"
Season.SPRING -> return "spring"
Season.SUMMER -> return "summer"
else -> return "autumn"
}
return "autumn"
}
fun bar2(x : Season) : String {
@@ -22,9 +22,8 @@ fun bar2(x : Season) : String {
Season.SPRING -> return "spring"
Season.SUMMER -> return "summer"
Season.AUTUMN -> return "autumn"
else -> return "fail unknown"
}
return "fail unknown"
}
// 2 TABLESWITCH