Fixed completion for extension function after removing members for implicit receiver from scope.
This commit is contained in:
+3
-1
@@ -12,4 +12,6 @@ fun f(pair: Pair<out Any, out Any>) {
|
||||
// EXIST: { lookupString: "hashCode", attributes: "bold" }
|
||||
// EXIST: { lookupString: "forString", attributes: "grayed" }
|
||||
// EXIST: { lookupString: "forAny", attributes: "bold" }
|
||||
// EXIST: { lookupString: "forT", attributes: "" }
|
||||
|
||||
/*TODO: { lookupString: "forT", attributes: "" }*/
|
||||
// EXIST: { lookupString: "forT", attributes: "grayed" }
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
interface A {
|
||||
fun foo(): Any
|
||||
fun bar()
|
||||
}
|
||||
interface B: A {
|
||||
override fun foo(): String
|
||||
}
|
||||
|
||||
fun f(pair: Pair<out A, out Any>) {
|
||||
if (pair.first !is B) return
|
||||
pair.first.<caret>
|
||||
}
|
||||
/*TODO: { lookupString: "foo", "typeText":"Any", attributes: "bold" } */
|
||||
// EXIST: { lookupString: "foo", "typeText":"String", attributes: "bold" }
|
||||
// EXIST: { lookupString: "bar", attributes: "bold" }
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
class B {
|
||||
fun A.extFunInBForA() {}
|
||||
fun B.extFunInBForB() {}
|
||||
|
||||
}
|
||||
class A {
|
||||
fun B.extFunInAForB() {}
|
||||
fun A.extFunInAForA() {}
|
||||
}
|
||||
|
||||
fun A.test() {
|
||||
with(B()) {
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: extFunInAForA
|
||||
// EXIST: extFunInBForA
|
||||
// EXIST: extFunInAForB
|
||||
// EXIST: extFunInBForB
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
class A {
|
||||
fun String.foo() {}
|
||||
}
|
||||
|
||||
fun Any.test() { // see KT-8865 Member extension after this smart cast not working
|
||||
if (this is A) {
|
||||
"".<caret>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// EXIST: foo
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
interface A {
|
||||
fun memberA()
|
||||
}
|
||||
|
||||
interface B {
|
||||
fun memberB()
|
||||
}
|
||||
|
||||
interface C {
|
||||
fun memberC()
|
||||
}
|
||||
|
||||
fun C.test(a: Any) {
|
||||
if (a is A && a is B) {
|
||||
a.<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: memberA
|
||||
// EXIST: memberB
|
||||
// ABSENT: memberC
|
||||
Reference in New Issue
Block a user