diff --git a/idea/testData/checkerWithErrorTypes/quick/nullabilityAndAutoCasts/InfixCallNullability.jet b/idea/testData/checkerWithErrorTypes/quick/nullabilityAndAutoCasts/InfixCallNullability.jet new file mode 100644 index 00000000000..d27f6834a73 --- /dev/null +++ b/idea/testData/checkerWithErrorTypes/quick/nullabilityAndAutoCasts/InfixCallNullability.jet @@ -0,0 +1,41 @@ +class A() { + fun plus(i : Int) {} + fun minus() {} + fun contains(a : Any?) : Boolean = true +} + +fun A.div(i : Int) {} +fun A?.times(i : Int) {} + +fun test(x : Int?, a : A?) { + x.plus(1) + x?.plus(1) + x plus 1 + x + 1 + -x + x.minus() + x?.minus() + + a.plus(1) + a?.plus(1) + a plus 1 + a + 1 + -a + a.minus() + a?.minus() + + a.div(1) + a / 1 + a div 1 + a?.div(1) + + a.times(1) + a * 1 + a times 1 + a?.times(1) + + 1 in a + a contains 1 + a.contains(1) + a?.contains(1) +} diff --git a/idea/testData/checkerWithErrorTypes/quick/nullabilityAndAutoCasts/PreferExtensionsOnNullableReceiver.jet b/idea/testData/checkerWithErrorTypes/quick/nullabilityAndAutoCasts/PreferExtensionsOnNullableReceiver.jet new file mode 100644 index 00000000000..b841960b590 --- /dev/null +++ b/idea/testData/checkerWithErrorTypes/quick/nullabilityAndAutoCasts/PreferExtensionsOnNullableReceiver.jet @@ -0,0 +1,9 @@ +class Foo { + fun foo() {} +} + +fun Any?.foo() {} + +fun test(f : Foo?) { + f.foo() +}