[FIR] Fix false positive case of CANNOT_CHECK_FOR_ERASED
Restore CANNOT_CHECK_FOR_ERASED as error
This commit is contained in:
committed by
teamcityserver
parent
850d76f6bf
commit
f05436b939
+8
-3
@@ -6,11 +6,11 @@ fun <E> foo(x: Any, y: Any) : Any {
|
||||
}
|
||||
|
||||
if (1 == 2) {
|
||||
x <!UNCHECKED_CAST!>as C<!>
|
||||
x as C
|
||||
}
|
||||
|
||||
if (2 == 3) {
|
||||
x <!UNCHECKED_CAST!>as? C<!>
|
||||
x as? C
|
||||
}
|
||||
|
||||
class Outer<F> {
|
||||
@@ -22,7 +22,12 @@ fun <E> foo(x: Any, y: Any) : Any {
|
||||
return y
|
||||
}
|
||||
|
||||
y <!UNCHECKED_CAST!>as Outer<*>.Inner<!>
|
||||
if (y is Outer<*>.Inner) {
|
||||
return y
|
||||
}
|
||||
|
||||
y as Outer<*>.Inner
|
||||
y as Outer.Inner
|
||||
|
||||
return C()
|
||||
}
|
||||
|
||||
+5
@@ -22,7 +22,12 @@ fun <E> foo(x: Any, y: Any) : Any {
|
||||
return y
|
||||
}
|
||||
|
||||
if (y is <!CANNOT_CHECK_FOR_ERASED!>Outer<*>.Inner<!>) {
|
||||
return y
|
||||
}
|
||||
|
||||
y <!UNCHECKED_CAST!>as Outer<*>.Inner<!>
|
||||
y <!USELESS_CAST!>as <!NO_TYPE_ARGUMENTS_ON_RHS!>Outer.Inner<!><!>
|
||||
|
||||
return C()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user