KT-4976 Completion ignores smart casts
#KT-4976 Fixed #KT-5718 Fixed
This commit is contained in:
+4
@@ -0,0 +1,4 @@
|
||||
package other
|
||||
|
||||
public val String.extensionPropNotImported: Int
|
||||
get() = 1
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
val String.extensionProp1: Int get() = 1
|
||||
val String.extensionProp2: Int get() = 1
|
||||
|
||||
fun foo(o: Any) {
|
||||
if (o !is String) return
|
||||
o.ext<caret>
|
||||
}
|
||||
|
||||
// EXIST: extensionProp1
|
||||
// EXIST: extensionProp2
|
||||
// EXIST: extensionPropNotImported
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Import" "true"
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
package c
|
||||
|
||||
import g.foo
|
||||
|
||||
class B
|
||||
|
||||
fun test(a: Any) {
|
||||
if (a is B) {
|
||||
a.<caret>foo()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Import" "true"
|
||||
// ERROR: Unresolved reference: foo
|
||||
|
||||
package c
|
||||
|
||||
class B
|
||||
|
||||
fun test(a: Any) {
|
||||
if (a is B) {
|
||||
a.<caret>foo()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package g
|
||||
|
||||
import c.B
|
||||
|
||||
fun B.foo() {}
|
||||
Reference in New Issue
Block a user