Intentions: Implement "Convert sealed class to enum" intention
#KT-14245 Fixed
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
enum class MyClass(val s: String = "") {
|
||||
FOO("FOO"), BAR("BAR"), DEFAULT();
|
||||
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
sealed class MyClass(val s: String = "") {
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
|
||||
object FOO : MyEnum("FOO")
|
||||
object BAR : MyEnum("BAR")
|
||||
object DEFAULT : MyEnum()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
This intention converts a sealed class to an enum class and replaces inheriting objects with enum entries
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user