Intentions: Implement intention which converts object literal to class
#KT-15056 Fixed
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
open class K
|
||||
|
||||
fun foo(n: Int) {
|
||||
val x = O(n)
|
||||
}
|
||||
|
||||
class O(private val n: Int) : K() {
|
||||
fun bar() = n
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
open class K
|
||||
|
||||
fun foo(n: Int) {
|
||||
val x = <spot>object</spot> : K() {
|
||||
fun bar() = n
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
This intention converts object literal to class and replaces object literal expression with constructor call.
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user