Respect receiver-dependent visibility when selecting smart-cast type
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
// !CHECK_TYPE
|
||||
open class BaseOuter {
|
||||
protected fun foo() = 1
|
||||
protected fun bar() { }
|
||||
}
|
||||
|
||||
class Foo(var base: BaseOuter)
|
||||
|
||||
fun BaseOuter.foo(): String = ""
|
||||
|
||||
class Derived : BaseOuter() {
|
||||
fun test(foo: Foo) {
|
||||
if (foo.base is Derived) {
|
||||
foo.base.foo() checkType { _<String>() } // Resolved to extension
|
||||
<!SMARTCAST_IMPOSSIBLE!>foo.base<!>.bar()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user