"Change return type fix" now handles data class properties correctly #KT-15028 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-12-05 11:51:55 +03:00
parent 0994d46038
commit 2ac8e5b4a7
10 changed files with 65 additions and 32 deletions
@@ -1,4 +1,4 @@
// "class org.jetbrains.kotlin.idea.quickfix.ChangeFunctionReturnTypeFix" "false"
// "class org.jetbrains.kotlin.idea.quickfix.ChangeCallableReturnTypeFix" "false"
// ERROR: Return type of 'foo' is not a subtype of the return type of the overridden member 'public abstract fun foo(): Int defined in A'
interface A {
fun foo(): Int
@@ -0,0 +1,8 @@
// "Change type of accessed property 'A.x' to 'String'" "true"
// See KT-15028 (CCE)
data class A(val x: Int, val y: String)
fun f1(a: A) {
val (x: String, y) = a<caret>
}
@@ -0,0 +1,8 @@
// "Change type of accessed property 'A.x' to 'String'" "true"
// See KT-15028 (CCE)
data class A(val x: String, val y: String)
fun f1(a: A) {
val (x: String, y) = a<caret>
}
@@ -1,4 +1,4 @@
// "class org.jetbrains.kotlin.idea.quickfix.ChangeFunctionReturnTypeFix" "false"
// "class org.jetbrains.kotlin.idea.quickfix.ChangeCallableReturnTypeFix" "false"
// ACTION: Change type of 'b' to 'A'
// ACTION: Convert property initializer to getter
// ACTION: Let 'A' implement interface 'B'