Add "Convert to notNull delegate" quick fix for INAPPLICABLE_LATEINIT_MODIFIER
#KT-12515 Fixed
This commit is contained in:
committed by
Dmitry Gridin
parent
b3b7e26985
commit
e3c9134904
@@ -0,0 +1,3 @@
|
||||
// "Convert to notNull delegate" "true"
|
||||
// WITH_RUNTIME
|
||||
<caret>lateinit var x: Boolean
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
// "Convert to notNull delegate" "true"
|
||||
// WITH_RUNTIME
|
||||
var x by Delegates.notNull<Boolean>()
|
||||
@@ -0,0 +1,3 @@
|
||||
// "Convert to notNull delegate" "true"
|
||||
// WITH_RUNTIME
|
||||
<caret>lateinit var x: Int
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
// "Convert to notNull delegate" "true"
|
||||
// WITH_RUNTIME
|
||||
var x by Delegates.notNull<Int>()
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Convert to notNull delegate" "false"
|
||||
// DISABLE-ERRORS
|
||||
// ACTION: Make internal
|
||||
// ACTION: Make private
|
||||
// ACTION: Remove 'lateinit' modifier
|
||||
// ACTION: Remove explicit type specification
|
||||
// ACTION: Remove initializer from property
|
||||
<caret>lateinit var x: Boolean = true
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Convert to notNull delegate" "false"
|
||||
// DISABLE-ERRORS
|
||||
// ACTION: Convert to nullable var
|
||||
// ACTION: Make internal
|
||||
// ACTION: Make private
|
||||
// ACTION: Specify type explicitly
|
||||
<caret>lateinit var x
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Convert to notNull delegate" "false"
|
||||
// ACTION: Convert to nullable var
|
||||
// ACTION: Make internal
|
||||
// ACTION: Make private
|
||||
<caret>lateinit var x: String
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Convert to notNull delegate" "false"
|
||||
// DISABLE-ERRORS
|
||||
// ACTION: Make internal
|
||||
// ACTION: Make not-nullable
|
||||
// ACTION: Make private
|
||||
// ACTION: Remove 'lateinit' modifier
|
||||
<caret>lateinit var x: Boolean?
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Convert to notNull delegate" "false"
|
||||
// DISABLE-ERRORS
|
||||
// ACTION: Change to var
|
||||
// ACTION: Make internal
|
||||
// ACTION: Make private
|
||||
// ACTION: Remove 'lateinit' modifier
|
||||
<caret>lateinit val x: Boolean
|
||||
Reference in New Issue
Block a user