EnhancedNullability annotation in IR
Fixes KT-40115 & KT-40117. Move FlexibleNullability annotation to 'kotlin.internal.ir'.
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
// FILE: nullabilityAnnotationsForReturnType.kt
|
||||
|
||||
fun testNotNull(): String = ""
|
||||
fun testNullable(): String? = ""
|
||||
fun testJavaNotNull() = J.returnsNotNull()
|
||||
fun testJavaNullable() = J.returnsNullable()
|
||||
fun testJavaFlexible() = J.returnsFlexible()
|
||||
|
||||
// FILE: J.java
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class J {
|
||||
public static @NotNull String returnsNotNull() { return ""; }
|
||||
public static @Nullable String returnsNullable() { return ""; }
|
||||
public static String returnsFlexible() { return ""; }
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
@kotlin.Metadata
|
||||
public final class NullabilityAnnotationsForReturnTypeKt {
|
||||
// source: 'nullabilityAnnotationsForReturnType.kt'
|
||||
public final static method testJavaFlexible(): java.lang.String
|
||||
public final static @org.jetbrains.annotations.NotNull method testJavaNotNull(): java.lang.String
|
||||
public final static @org.jetbrains.annotations.Nullable method testJavaNullable(): java.lang.String
|
||||
public final static @org.jetbrains.annotations.NotNull method testNotNull(): java.lang.String
|
||||
public final static @org.jetbrains.annotations.Nullable method testNullable(): java.lang.String
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// FILE: nullabilityAnnotationsOnDelegatedMembers.kt
|
||||
class JImpl(j: J) : J by j
|
||||
|
||||
// FILE: J.java
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public interface J {
|
||||
void takeNotNull(@NotNull String x);
|
||||
void takeNullable(@Nullable String x);
|
||||
void takeFlexible(String x);
|
||||
@NotNull String returnNotNull();
|
||||
@Nullable String returnNullable();
|
||||
String returnsFlexible();
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
@kotlin.Metadata
|
||||
public final class JImpl {
|
||||
// source: 'nullabilityAnnotationsOnDelegatedMembers.kt'
|
||||
private synthetic final field $$delegate_0: J
|
||||
public method <init>(@org.jetbrains.annotations.NotNull p0: J): void
|
||||
public @org.jetbrains.annotations.NotNull method returnNotNull(): java.lang.String
|
||||
public @org.jetbrains.annotations.Nullable method returnNullable(): java.lang.String
|
||||
public method returnsFlexible(): java.lang.String
|
||||
public method takeFlexible(p0: java.lang.String): void
|
||||
public method takeNotNull(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
||||
public method takeNullable(@org.jetbrains.annotations.Nullable p0: java.lang.String): void
|
||||
}
|
||||
Reference in New Issue
Block a user