[FIR] Add UNCHECKED_CAST

Regenerate diagnostics code
This commit is contained in:
Ivan Kochurkin
2021-09-16 23:24:58 +03:00
committed by TeamCityServer
parent 1fbccff1bd
commit d0a4ca199d
70 changed files with 118 additions and 933 deletions
@@ -140,8 +140,8 @@ fun case_12(value_1: Int, value_2: Collection<Int>, value_3: Collection<Int>?) {
when {
value_1 == 1 -> value_2 as List<Int>
value_1 == 2 -> value_2 as? List<Int>
value_1 == 3 -> value_3 as? MutableMap<Int, Int>
value_1 == 4 -> (value_2 as? Map<Int, Int>) as MutableMap<Int, Int>
value_1 == 3 -> value_3 <!UNCHECKED_CAST!>as? MutableMap<Int, Int><!>
value_1 == 4 -> (value_2 <!UNCHECKED_CAST!>as? Map<Int, Int><!>) as MutableMap<Int, Int>
}
}
@@ -143,8 +143,8 @@ fun case_12(value_1: Int, value_2: Collection<Int>, value_3: Collection<Int>?) {
when (value_1) {
1 -> value_2 as List<Int>
2 -> value_2 as? List<Int>
3 -> value_3 as? MutableMap<Int, Int>
4 -> (value_2 as? Map<Int, Int>) as MutableMap<Int, Int>
3 -> value_3 <!UNCHECKED_CAST!>as? MutableMap<Int, Int><!>
4 -> (value_2 <!UNCHECKED_CAST!>as? Map<Int, Int><!>) as MutableMap<Int, Int>
}
}
@@ -105,8 +105,8 @@ fun case_10(value_1: Collection<Int>, value_2: Collection<Int>, value_3: Collect
when (value_1) {
value_2 as List<Int> -> {}
value_2 as? List<Int> -> {}
value_3 as? MutableMap<Int, Int> -> {}
(value_2 as? Map<Int, Int>) as MutableMap<Int, Int> -> {}
value_3 <!UNCHECKED_CAST!>as? MutableMap<Int, Int><!> -> {}
(value_2 <!UNCHECKED_CAST!>as? Map<Int, Int><!>) as MutableMap<Int, Int> -> {}
}
}
@@ -81,7 +81,7 @@ fun case_9(value_1: Any) {
fun case_10(value_1: Collection<Int>, value_2: Collection<Int>, value_3: Collection<Int>?) {
when (value_1) {
value_2 as List<Int>, value_2 as? List<Int> -> {}
value_3 as? MutableMap<Int, Int>, (value_2 as? Map<Int, Int>) as MutableMap<Int, Int> -> {}
value_3 <!UNCHECKED_CAST!>as? MutableMap<Int, Int><!>, (value_2 <!UNCHECKED_CAST!>as? Map<Int, Int><!>) as MutableMap<Int, Int> -> {}
}
}
@@ -4,8 +4,8 @@
// TESTCASE NUMBER: 1
fun <T, K> case_1(x: T?, y: K?) {
x as T
y as K
x <!UNCHECKED_CAST!>as T<!>
y <!UNCHECKED_CAST!>as K<!>
val z = <!DEBUG_INFO_EXPRESSION_TYPE("T? & T")!>x<!> ?: <!DEBUG_INFO_EXPRESSION_TYPE("K? & K")!>y<!>
<!DEBUG_INFO_EXPRESSION_TYPE("T? & T")!>x<!><!UNSAFE_CALL!>.<!>equals(10)
@@ -4,7 +4,7 @@
// TESTCASE NUMBER: 1
fun <T> case_1(x: Any?) where T: CharSequence {
x as T
x <!UNCHECKED_CAST!>as T<!>
class Case1<K> where K : T {
inline fun <reified T : Number> case_1() {
if (x is T) {
@@ -10,9 +10,9 @@ open class Case1<K : Number> {
open inner class Case1_1<L>: Case1<Int>() where L : CharSequence {
inner class Case1_2<M>: Case1<K>.Case1_1<<!UPPER_BOUND_VIOLATED!>M<!>>() where M : Map<K, L> {
inline fun <reified T>case_1(x: Any?) {
x as M
x as L
x as K
x <!UNCHECKED_CAST!>as M<!>
x <!UNCHECKED_CAST!>as L<!>
x <!UNCHECKED_CAST!>as K<!>
if (x is T) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & M & L & K & T!!")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & M & L & K & T!!")!>x<!>.toByte()
@@ -10,9 +10,9 @@ open class Case1<K : Number> {
open inner class Case1_1<L>: Case1<Int>() where L : CharSequence {
inner class Case1_2<M>: Case1<K>.Case1_1<<!UPPER_BOUND_VIOLATED!>M<!>>() where M : Map<K, L> {
inline fun <reified T>case_1(x: Any?) {
x as M
x as L
x as K
x <!UNCHECKED_CAST!>as M<!>
x <!UNCHECKED_CAST!>as L<!>
x <!UNCHECKED_CAST!>as K<!>
if (x is T) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & M & L & K & T!!")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & M & L & K & T!!")!>x<!>.toByte()
@@ -10,9 +10,9 @@ open class Case1<K : Number> {
open inner class Case1_1<L>: Case1<Int>() where L : CharSequence {
inner class Case1_2<M>: Case1<K>.Case1_1<<!UPPER_BOUND_VIOLATED!>M<!>>() where M : Map<K, L> {
inline fun <reified T>case_1(x: Any?) {
x as M
x as L
x as K
x <!UNCHECKED_CAST!>as M<!>
x <!UNCHECKED_CAST!>as L<!>
x <!UNCHECKED_CAST!>as K<!>
if (x is T) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & M & L & K & T!!")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & M & L & K & T!!")!>x<!>.toByte()
@@ -85,7 +85,7 @@ fun <T> Inv<out T>.case_7() {
// TESTCASE NUMBER: 8
fun <T> T.case_8() {
this as MutableList<T>
this <!UNCHECKED_CAST!>as MutableList<T><!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.reflect.KFunction1<kotlin.Any?, kotlin.Boolean>")!>this::equals<!>
this.equals(10)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.reflect.KFunction1<kotlin.Any?, kotlin.Boolean>")!>::equals<!>
@@ -9,7 +9,7 @@
*/
fun case_1() {
val list = mutableListOf<String>()
val ints = list as MutableList<Int>
val ints = list <!UNCHECKED_CAST!>as MutableList<Int><!>
val strs = list as MutableList<String>
strs.add("two")
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.MutableList<kotlin.String> & kotlin.collections.MutableList<kotlin.Int> & kotlin.collections.MutableList<kotlin.String>")!>list<!>