Fix KotlinType.isNullabilityFlexible for types based on type parameters
In the compiler, this function was used in psi2ir (and it affected nullability annotations in the resulting JVM class files), in "useless elvis with null on the right side" diagnostic checker, and in light classes. #KT-42650 Fixed
This commit is contained in:
+10
@@ -1,8 +1,18 @@
|
||||
// WITH_RUNTIME
|
||||
// FILE: test.kt
|
||||
|
||||
import java.util.Collections
|
||||
|
||||
class PlatformTypes {
|
||||
fun simplyPlatform() = Collections.singletonList("")[0]
|
||||
fun bothNullable() = Collections.emptyList<String>() ?: null
|
||||
fun bothNotNull() = Collections.emptyList<String>()!!
|
||||
|
||||
fun <R> generic(j: J<R>) = j.get()
|
||||
}
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public interface J<R> {
|
||||
R get();
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,8 +1,9 @@
|
||||
@kotlin.Metadata
|
||||
public final class PlatformTypes {
|
||||
// source: 'platformTypes.kt'
|
||||
// source: 'test.kt'
|
||||
public method <init>(): void
|
||||
public final @org.jetbrains.annotations.NotNull method bothNotNull(): java.util.List
|
||||
public final @org.jetbrains.annotations.Nullable method bothNullable(): java.util.List
|
||||
public final method generic(@org.jetbrains.annotations.NotNull p0: J): java.lang.Object
|
||||
public final method simplyPlatform(): java.lang.String
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user