Inspection: convert initialized val to non-null type
^KT-35757 Fixed
This commit is contained in:
committed by
Vladimir Dolzhenko
parent
8b28e54584
commit
18fbf5729d
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.inspections.ConvertInitializedValToNonNullTypeInspection
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
val s1: String?<caret> = bar()
|
||||
}
|
||||
|
||||
fun bar(): String = ""
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
val s1: String = bar()
|
||||
}
|
||||
|
||||
fun bar(): String = ""
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
fun foo() {
|
||||
val s0: String = ""
|
||||
val s1: String?<caret> = s0
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
fun foo() {
|
||||
val s0: String = ""
|
||||
val s1: String = s0
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun foo() {
|
||||
val s: String?<caret> = "Hello"
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun foo() {
|
||||
val s: String = "Hello"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// PROBLEM: none
|
||||
fun foo() {
|
||||
val s1: String? = bar()
|
||||
val s2: String?<caret> = null
|
||||
}
|
||||
|
||||
fun bar(): String? = ""
|
||||
Reference in New Issue
Block a user