Fix MovePropertyToConstructorIntention applicability and type rendering

#KT-17238 Fixed

(cherry picked from commit 7f9d88a)
This commit is contained in:
Vyacheslav Gerasimov
2017-04-07 11:45:54 +03:00
parent d65b7a5b4b
commit 6b9242075a
11 changed files with 110 additions and 5 deletions
@@ -0,0 +1,9 @@
class Baz
fun foo(a: Int, b: String, d: Baz) {
}
class TestClass {
val <caret>prop1 = ::foo
}
@@ -0,0 +1,10 @@
import kotlin.reflect.KFunction3
class Baz
fun foo(a: Int, b: String, d: Baz) {
}
class TestClass(val prop1: KFunction3<@ParameterName(name = "a") Int, @ParameterName(name = "b") String, @ParameterName(name = "d") Baz, Unit> = ::foo) {
}
@@ -0,0 +1,3 @@
class TestClass {
val <caret>prop2 = { a: Int, b: String -> }
}
@@ -0,0 +1,2 @@
class TestClass(val prop2: (Int, String) -> Unit = { a: Int, b: String -> }) {
}
@@ -0,0 +1,3 @@
class TestClass {
val <caret>prop2 = { }
}
@@ -0,0 +1,2 @@
class TestClass(val prop2: () -> Unit = { }) {
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
class Baz
class TestClass {
val <caret>c = mapOf("foo" to Baz())
}
@@ -0,0 +1,6 @@
// WITH_RUNTIME
class Baz
class TestClass(val c: Map<String, Baz> = mapOf("foo" to Baz())) {
}
@@ -0,0 +1,9 @@
// IS_APPLICABLE: false
class MySuperClass() {
val <caret>prop5 = this::test
fun test() {
}
}