Fix invalid usage of descriptorToDeclaration in QuickFixFactoryForTypeMismatchError

This commit is contained in:
Pavel V. Talanov
2014-06-23 19:17:59 +04:00
parent 0673dc51d6
commit 41dd12d46b
4 changed files with 75 additions and 9 deletions
@@ -0,0 +1,19 @@
// "Change 'AA.f' function return type to 'Boolean'" "false"
// ACTION: Change 'AAA.g' function return type to 'Int'
// ACTION: Convert to expression body
// ACTION: Disable 'Convert to Expression Body'
// ACTION: Edit intention settings
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>kotlin.Boolean</td></tr><tr><td>Found:</td><td>kotlin.Int</td></tr></table></html>
trait A {
fun f(): Int
}
open class AA {
fun f() = 3
}
class AAA: AA(), A {
fun g(): Boolean {
return f<caret>()
}
}
@@ -0,0 +1,22 @@
// "Change 'AA.contains' function return type to 'Int'" "false"
// ACTION: Change 'AAA.g' function return type to 'Boolean'
// ACTION: Convert to expression body
// ACTION: Disable 'Convert to Expression Body'
// ACTION: Disable 'Replace Overloaded Operator With Function Call'
// ACTION: Edit intention settings
// ACTION: Edit intention settings
// ACTION: Replace overloaded operator with function call
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>kotlin.Int</td></tr><tr><td>Found:</td><td>kotlin.Boolean</td></tr></table></html>
trait A {
fun contains(i: Int): Boolean
}
open class AA {
fun contains(i: Int) = true
}
class AAA: AA(), A {
fun g(): Int {
return 3 i<caret>n this
}
}