// !LANGUAGE: +StrictJavaNullabilityAssertions -ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated // TARGET_BACKEND: JVM // IGNORE_BACKEND_FIR: JVM_IR // FIR status: expected: but was: , issue related to T & Any // See KT-8135 // We could generate runtime assertion on call site for 'generic()' below. // FILE: box.kt fun box(): String { try { J().test() return "OK" } catch (e: Throwable) { return "Fail: SHOULD NOT throw" } } // FILE: test.kt fun withAssertion(j: J) = generic(j) fun generic(j: J) = j.nullT() // FILE: J.java import org.jetbrains.annotations.NotNull; public class J { @NotNull public T nullT() { return null; } public void test() { TestKt.withAssertion(this); } }