Files
openide/plugins/kotlin/idea/tests/testData/quickfix/addExclExclCall/javaNullabilityMismatchWithImplicitReceiver.test
2024-04-15 11:52:39 +00:00

51 lines
903 B
Plaintext

// FILE: test.before.kt
// "Add non-null asserted (this!!) call" "true"
// WITH_STDLIB
package p;
fun test(x: Foo) {
with (x.foo()) {
this<caret>.bar()
}
}
// FILE: org/jspecify/nullness/Nullable.java
package org.jspecify.nullness;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@Target(TYPE_USE)
@Retention(RUNTIME)
public @interface Nullable {}
// FILE: p/A.java
package p;
public class A {
public void bar() {}
}
// FILE: p/Foo.java
package p;
import org.jspecify.nullness.Nullable;
public class Foo {
public @Nullable A foo() { return null; }
}
// FILE: test.after.kt
// "Add non-null asserted (this!!) call" "true"
// WITH_STDLIB
package p;
fun test(x: Foo) {
with (x.foo()) {
this<caret>!!.bar()
}
}