Files
kotlin-fork/compiler/testData/diagnostics/tests/explicitDefinitelyNotNullableViaIntersection/notApplicable.fir.kt
T
Nikolay Lunyak 3d9c77efa8 [FIR] Add DNN checks
Merge-request: KT-MR-7000
Merged-by: Nikolay Lunyak <lunyak.kolya@mail.ru>
2022-09-01 14:25:07 +00:00

19 lines
1.3 KiB
Kotlin
Vendored

// !LANGUAGE: +DefinitelyNonNullableTypes
fun <T : Any> foo(x: <!INCORRECT_LEFT_COMPONENT_OF_INTERSECTION!>T<!> & Any, y: <!INCORRECT_LEFT_COMPONENT_OF_INTERSECTION!>List<<!INCORRECT_LEFT_COMPONENT_OF_INTERSECTION!>String<!> & Any><!> & Any) {}
fun <F> bar1(x: <!INCORRECT_LEFT_COMPONENT_OF_INTERSECTION!>F?<!> & Any) {}
fun <F> bar2(x: F & <!INCORRECT_RIGHT_COMPONENT_OF_INTERSECTION!>Any?<!>) {}
fun <F> bar3(x: <!INCORRECT_LEFT_COMPONENT_OF_INTERSECTION!>(F?)<!> & Any) {}
fun <F> bar4(x: <!NULLABLE_ON_DEFINITELY_NOT_NULLABLE!>(F & Any)?<!>) {}
fun <F> bar5(x: F & <!INCORRECT_RIGHT_COMPONENT_OF_INTERSECTION!>String<!>) {}
fun <F> bar6(x: F & <!INCORRECT_RIGHT_COMPONENT_OF_INTERSECTION!>(F & Any)<!>) {}
fun <F> bar7(x: <!INCORRECT_LEFT_COMPONENT_OF_INTERSECTION!>(F & Any)<!> & Any) {}
fun <F> bar8(x: (F & Any).() -> Unit) {}
fun <F> (F & Any).bar9(x: () -> Unit) {}
fun <F> bar10(x: F & <!INCORRECT_RIGHT_COMPONENT_OF_INTERSECTION!><!INCORRECT_LEFT_COMPONENT_OF_INTERSECTION!>Any<!> & <!INCORRECT_RIGHT_COMPONENT_OF_INTERSECTION!>String<!><!>) {}
fun <F> bar11(x: <!INCORRECT_LEFT_COMPONENT_OF_INTERSECTION!>Double<!> & <!INCORRECT_RIGHT_COMPONENT_OF_INTERSECTION!><!INCORRECT_LEFT_COMPONENT_OF_INTERSECTION!>Any<!> & <!INCORRECT_RIGHT_COMPONENT_OF_INTERSECTION!>String<!><!>) {}