Add "Change to val" quick fix for MUST_BE_INITIALIZED

#KT-15723 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-02-18 22:50:36 +09:00
committed by Vladimir Dolzhenko
parent a46c6ce5df
commit c87bc2123c
8 changed files with 64 additions and 0 deletions
@@ -0,0 +1,5 @@
// "Change to val" "true"
class Test {
var foo<caret>
get() = 1
}
@@ -0,0 +1,5 @@
// "Change to val" "true"
class Test {
val foo
get() = 1
}
@@ -0,0 +1,7 @@
// "Change to val" "true"
class Test {
var foo: Int<caret>
get() {
return 1
}
}
@@ -0,0 +1,7 @@
// "Change to val" "true"
class Test {
val foo: Int
get() {
return 1
}
}
@@ -0,0 +1,14 @@
// "Change to val" "false"
// ACTION: Add initializer
// ACTION: Convert member to extension
// ACTION: Initialize with constructor parameter
// ACTION: Introduce backing property
// ACTION: Move to companion object
// ACTION: Specify type explicitly
// ERROR: Property must be initialized
class Test {
var foo<caret>
get() {
return 1
}
}