Forbid dynamic on the RHS of is and as
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
// !DIAGNOSTICS: -REDUNDANT_NULLABLE
|
||||
|
||||
// MODULE[js]: m1
|
||||
// FILE: k.kt
|
||||
|
||||
fun test(d: Any, dl: Collection<dynamic>) {
|
||||
d as <!DYNAMIC_NOT_ALLOWED!>dynamic<!>
|
||||
d as <!DYNAMIC_NOT_ALLOWED!>dynamic?<!>
|
||||
|
||||
d as? <!DYNAMIC_NOT_ALLOWED!>dynamic<!>
|
||||
d as? <!DYNAMIC_NOT_ALLOWED!>dynamic?<!>
|
||||
|
||||
d is <!DYNAMIC_NOT_ALLOWED!>dynamic<!>
|
||||
d is <!DYNAMIC_NOT_ALLOWED!>dynamic?<!>
|
||||
|
||||
d !is <!DYNAMIC_NOT_ALLOWED!>dynamic<!>
|
||||
d !is <!DYNAMIC_NOT_ALLOWED!>dynamic?<!>
|
||||
|
||||
when (d) {
|
||||
is <!DYNAMIC_NOT_ALLOWED!>dynamic<!> -> {}
|
||||
is <!DYNAMIC_NOT_ALLOWED!>dynamic?<!> -> {}
|
||||
!is <!DYNAMIC_NOT_ALLOWED!>dynamic<!> -> {}
|
||||
!is <!DYNAMIC_NOT_ALLOWED!>dynamic?<!> -> {}
|
||||
}
|
||||
|
||||
dl as List<dynamic>
|
||||
dl is List<dynamic>
|
||||
|
||||
when (dl) {
|
||||
is List<dynamic> -> {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
internal fun test(/*0*/ d: kotlin.Any, /*1*/ dl: kotlin.Collection<dynamic>): kotlin.Unit
|
||||
Reference in New Issue
Block a user