Intentions: Implement intention which converts object literal to class

#KT-15056 Fixed
This commit is contained in:
Alexey Sedunov
2016-12-22 21:17:59 +03:00
parent 7def536751
commit 534a773816
15 changed files with 232 additions and 0 deletions
@@ -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
}
@@ -0,0 +1,7 @@
open class K
fun foo(n: Int) {
val x = <spot>object</spot> : K() {
fun bar() = n
}
}
@@ -0,0 +1,5 @@
<html>
<body>
This intention converts object literal to class and replaces object literal expression with constructor call.
</body>
</html>