UsePropertyAccessSyntaxIntention: handled case when property type is more specific

This commit is contained in:
Valentin Kipyatkov
2015-08-12 17:57:08 +03:00
parent 6fcb75cfb5
commit 7b149c10c1
8 changed files with 108 additions and 16 deletions
@@ -0,0 +1,4 @@
interface JavaInterface {
Object getSomething();
void setSomething(Object value);
}
@@ -0,0 +1,11 @@
// IS_APPLICABLE: false
// WITH_RUNTIME
abstract class KotlinClass : JavaInterface {
override fun getSomething(): String = ""
}
fun foo(k: KotlinClass) {
k.<caret>setSomething(1)
}
@@ -0,0 +1,4 @@
interface JavaInterface {
Object getSomething();
void setSomething(Object value);
}
@@ -0,0 +1,4 @@
interface JavaInterface {
Object getSomething();
void setSomething(Object value);
}
@@ -0,0 +1,12 @@
// WITH_RUNTIME
abstract class KotlinClass : JavaInterface {
override fun getSomething(): String = ""
}
fun foo(k: KotlinClass, p: Any) {
if (p is String) {
k.<caret>setSomething(p)
}
}
@@ -0,0 +1,12 @@
// WITH_RUNTIME
abstract class KotlinClass : JavaInterface {
override fun getSomething(): String = ""
}
fun foo(k: KotlinClass, p: Any) {
if (p is String) {
k.something = p
}
}