[FIR] Fix collecting member candidates on receiver with smartcast
^KT-51460 Fixed ^KT-51827
This commit is contained in:
committed by
teamcity
parent
51bd0fd2db
commit
6e2402620f
+41
@@ -0,0 +1,41 @@
|
||||
interface A<T : A<T>> {
|
||||
val symbol: ASymbol<T>
|
||||
}
|
||||
|
||||
interface B<T : B<T>> : A<T> {
|
||||
override val symbol: BSymbol<T>
|
||||
}
|
||||
|
||||
interface C : B<C> {
|
||||
fun foo()
|
||||
|
||||
override val symbol: CSymbol
|
||||
}
|
||||
|
||||
interface ASymbol<T : A<T>> {
|
||||
var value: T
|
||||
}
|
||||
|
||||
interface BSymbol<T : B<T>> : ASymbol<T>
|
||||
|
||||
interface CSymbol : BSymbol<C> {
|
||||
fun bar()
|
||||
}
|
||||
|
||||
fun test_1(symbol: BSymbol<*>) {
|
||||
if (symbol is CSymbol) {
|
||||
symbol.value.foo()
|
||||
}
|
||||
}
|
||||
|
||||
fun test_2(b: B<*>) {
|
||||
if (b is C) {
|
||||
b.symbol.bar()
|
||||
}
|
||||
}
|
||||
|
||||
fun <F : B<F>> test_3(b: B<F>) {
|
||||
if (b is C) {
|
||||
b.symbol.bar()
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
interface A<T : A<T>> {
|
||||
val symbol: ASymbol<T>
|
||||
}
|
||||
|
||||
interface B<T : B<T>> : A<T> {
|
||||
override val symbol: BSymbol<T>
|
||||
}
|
||||
|
||||
interface C : B<C> {
|
||||
fun foo()
|
||||
|
||||
override val symbol: CSymbol
|
||||
}
|
||||
|
||||
interface ASymbol<T : A<T>> {
|
||||
var value: T
|
||||
}
|
||||
|
||||
interface BSymbol<T : B<T>> : ASymbol<T>
|
||||
|
||||
interface CSymbol : BSymbol<C> {
|
||||
fun bar()
|
||||
}
|
||||
|
||||
fun test_1(symbol: BSymbol<*>) {
|
||||
if (symbol is CSymbol) {
|
||||
symbol.value.foo()
|
||||
}
|
||||
}
|
||||
|
||||
fun test_2(b: B<*>) {
|
||||
if (b is C) {
|
||||
b.symbol.bar()
|
||||
}
|
||||
}
|
||||
|
||||
fun <F : B<F>> test_3(b: B<F>) {
|
||||
if (b is C) {
|
||||
<!DEBUG_INFO_SMARTCAST!>b<!>.symbol.bar()
|
||||
}
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package
|
||||
|
||||
public fun test_1(/*0*/ symbol: BSymbol<*>): kotlin.Unit
|
||||
public fun test_2(/*0*/ b: B<*>): kotlin.Unit
|
||||
public fun </*0*/ F : B<F>> test_3(/*0*/ b: B<F>): kotlin.Unit
|
||||
|
||||
public interface A</*0*/ T : A<T>> {
|
||||
public abstract val symbol: ASymbol<T>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface ASymbol</*0*/ T : A<T>> {
|
||||
public abstract var value: T
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface B</*0*/ T : B<T>> : A<T> {
|
||||
public abstract override /*1*/ val symbol: BSymbol<T>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface BSymbol</*0*/ T : B<T>> : ASymbol<T> {
|
||||
public abstract override /*1*/ /*fake_override*/ var value: T
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface C : B<C> {
|
||||
public abstract override /*1*/ val symbol: CSymbol
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public abstract fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface CSymbol : BSymbol<C> {
|
||||
public abstract override /*1*/ /*fake_override*/ var value: C
|
||||
public abstract fun bar(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// FIR_IDENTICAL
|
||||
// ISSUE: KT-51460
|
||||
|
||||
abstract class A {
|
||||
abstract protected val a: A?
|
||||
|
||||
class B(override val a: A?) : A() {
|
||||
fun f(other: A) {
|
||||
val x = if (other is C) {
|
||||
other.a
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class C(override val a: A?): A()
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package
|
||||
|
||||
public abstract class A {
|
||||
public constructor A()
|
||||
protected abstract val a: A?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public final class B : A {
|
||||
public constructor B(/*0*/ a: A?)
|
||||
protected open override /*1*/ val a: A?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun f(/*0*/ other: A): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class C : A {
|
||||
public constructor C(/*0*/ a: A?)
|
||||
protected open override /*1*/ val a: A?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
Vendored
+84
@@ -0,0 +1,84 @@
|
||||
// FIR_IDENTICAL
|
||||
interface Base {
|
||||
fun baseFun()
|
||||
}
|
||||
|
||||
interface Derived : Base {
|
||||
fun derivedFun()
|
||||
}
|
||||
|
||||
abstract class A<T : Base> {
|
||||
protected val a: T = null!!
|
||||
|
||||
fun fest_1(other: A<*>) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
other.a.baseFun()
|
||||
other.a.derivedFun()
|
||||
}
|
||||
if (other is C) {
|
||||
other.a.baseFun()
|
||||
other.a.derivedFun()
|
||||
}
|
||||
if (other is D) {
|
||||
other.a.baseFun()
|
||||
other.a.derivedFun()
|
||||
}
|
||||
}
|
||||
|
||||
open class B : A<Derived>() {
|
||||
class Nested {
|
||||
fun fest_3(other: A<*>) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
other.a.baseFun()
|
||||
other.a.derivedFun()
|
||||
}
|
||||
if (other is C) {
|
||||
other.a.baseFun()
|
||||
other.a.derivedFun()
|
||||
}
|
||||
if (other is D) {
|
||||
other.a.baseFun()
|
||||
other.a.derivedFun()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class C : B() {
|
||||
fun fest_4(other: A<*>) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
other.a.baseFun()
|
||||
other.a.derivedFun()
|
||||
}
|
||||
if (other is C) {
|
||||
other.a.baseFun()
|
||||
other.a.derivedFun()
|
||||
}
|
||||
if (other is D) {
|
||||
other.a.baseFun()
|
||||
other.a.derivedFun()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class D : A<Derived>() {
|
||||
fun fest_5(other: A<*>) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
other.a.baseFun()
|
||||
other.a.derivedFun()
|
||||
}
|
||||
if (other is C) {
|
||||
other.a.baseFun()
|
||||
other.a.derivedFun()
|
||||
}
|
||||
if (other is D) {
|
||||
other.a.baseFun()
|
||||
other.a.derivedFun()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+63
@@ -0,0 +1,63 @@
|
||||
package
|
||||
|
||||
public abstract class A</*0*/ T : Base> {
|
||||
public constructor A</*0*/ T : Base>()
|
||||
protected final val a: T
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun fest_1(/*0*/ other: A<*>): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public open class B : A<Derived> {
|
||||
public constructor B()
|
||||
protected final override /*1*/ /*fake_override*/ val a: Derived
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun fest_1(/*0*/ other: A<*>): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public final class Nested {
|
||||
public constructor Nested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun fest_3(/*0*/ other: A<*>): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public final class C : A.B {
|
||||
public constructor C()
|
||||
protected final override /*1*/ /*fake_override*/ val a: Derived
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun fest_1(/*0*/ other: A<*>): kotlin.Unit
|
||||
public final fun fest_4(/*0*/ other: A<*>): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class D : A<Derived> {
|
||||
public constructor D()
|
||||
protected final override /*1*/ /*fake_override*/ val a: Derived
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun fest_1(/*0*/ other: A<*>): kotlin.Unit
|
||||
public final fun fest_5(/*0*/ other: A<*>): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public interface Base {
|
||||
public abstract fun baseFun(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface Derived : Base {
|
||||
public abstract override /*1*/ /*fake_override*/ fun baseFun(): kotlin.Unit
|
||||
public abstract fun derivedFun(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
Vendored
+68
@@ -0,0 +1,68 @@
|
||||
// FIR_IDENTICAL
|
||||
interface Base {
|
||||
fun baseFun()
|
||||
}
|
||||
|
||||
abstract class A {
|
||||
protected val a: Base = null!!
|
||||
|
||||
fun fest_1(other: A) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
if (other is C) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
if (other is D) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
}
|
||||
|
||||
open class B : A() {
|
||||
class Nested {
|
||||
fun fest_3(other: A) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
if (other is C) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
if (other is D) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class C : B() {
|
||||
fun fest_4(other: A) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
if (other is C) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
if (other is D) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class D : A() {
|
||||
fun fest_5(other: A) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
if (other is C) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
if (other is D) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+55
@@ -0,0 +1,55 @@
|
||||
package
|
||||
|
||||
public abstract class A {
|
||||
public constructor A()
|
||||
protected final val a: Base
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun fest_1(/*0*/ other: A): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public open class B : A {
|
||||
public constructor B()
|
||||
protected final override /*1*/ /*fake_override*/ val a: Base
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun fest_1(/*0*/ other: A): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public final class Nested {
|
||||
public constructor Nested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun fest_3(/*0*/ other: A): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public final class C : A.B {
|
||||
public constructor C()
|
||||
protected final override /*1*/ /*fake_override*/ val a: Base
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun fest_1(/*0*/ other: A): kotlin.Unit
|
||||
public final fun fest_4(/*0*/ other: A): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class D : A {
|
||||
public constructor D()
|
||||
protected final override /*1*/ /*fake_override*/ val a: Base
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun fest_1(/*0*/ other: A): kotlin.Unit
|
||||
public final fun fest_5(/*0*/ other: A): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public interface Base {
|
||||
public abstract fun baseFun(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
// FIR_DUMP
|
||||
|
||||
interface Base {
|
||||
fun baseFun()
|
||||
}
|
||||
|
||||
interface Derived : Base {
|
||||
fun derivedFun()
|
||||
}
|
||||
|
||||
abstract class A {
|
||||
abstract protected val a: Base
|
||||
|
||||
fun fest_1(other: A) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
other.a.baseFun()
|
||||
other.a.<!UNRESOLVED_REFERENCE!>derivedFun<!>()
|
||||
}
|
||||
if (other is C) {
|
||||
other.a.baseFun()
|
||||
other.a.<!UNRESOLVED_REFERENCE!>derivedFun<!>()
|
||||
}
|
||||
if (other is D) {
|
||||
other.a.baseFun()
|
||||
other.a.<!UNRESOLVED_REFERENCE!>derivedFun<!>()
|
||||
}
|
||||
}
|
||||
|
||||
open class B(override val a: Derived) : A() {
|
||||
class Nested {
|
||||
fun fest_3(other: A) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
other.a.baseFun()
|
||||
other.a.derivedFun()
|
||||
}
|
||||
if (other is C) {
|
||||
other.a.baseFun()
|
||||
other.a.<!UNRESOLVED_REFERENCE!>derivedFun<!>()
|
||||
}
|
||||
if (other is D) {
|
||||
other.a.baseFun()
|
||||
other.a.<!UNRESOLVED_REFERENCE!>derivedFun<!>()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class C(override val a: Derived) : B(a) {
|
||||
fun fest_4(other: A) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
other.a.baseFun()
|
||||
other.a.<!UNRESOLVED_REFERENCE!>derivedFun<!>()
|
||||
}
|
||||
if (other is C) {
|
||||
other.a.baseFun()
|
||||
other.a.derivedFun()
|
||||
}
|
||||
if (other is D) {
|
||||
other.a.baseFun()
|
||||
other.a.<!UNRESOLVED_REFERENCE!>derivedFun<!>()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class D(override val a: Derived) : A() {
|
||||
fun fest_5(other: A) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
other.a.baseFun()
|
||||
other.a.<!UNRESOLVED_REFERENCE!>derivedFun<!>()
|
||||
}
|
||||
if (other is C) {
|
||||
other.a.baseFun()
|
||||
other.a.<!UNRESOLVED_REFERENCE!>derivedFun<!>()
|
||||
}
|
||||
if (other is D) {
|
||||
other.a.baseFun()
|
||||
other.a.derivedFun()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+155
@@ -0,0 +1,155 @@
|
||||
FILE: protectedVisibilityAndSmartcast_overrideChangesType.fir.kt
|
||||
public abstract interface Base : R|kotlin/Any| {
|
||||
public abstract fun baseFun(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public abstract interface Derived : R|Base| {
|
||||
public abstract fun derivedFun(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public abstract class A : R|kotlin/Any| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
protected abstract val a: R|Base|
|
||||
protected get(): R|Base|
|
||||
|
||||
public final fun fest_1(other: R|A|): R|kotlin/Unit| {
|
||||
R|<local>/other|.R|/A.a|.R|/Base.baseFun|()
|
||||
when () {
|
||||
(R|<local>/other| is R|A.B|) -> {
|
||||
R|<local>/other|.R|/A.a|.R|/Base.baseFun|()
|
||||
R|<local>/other|.R|/A.a|.<Unresolved name: derivedFun>#()
|
||||
}
|
||||
}
|
||||
|
||||
when () {
|
||||
(R|<local>/other| is R|A.C|) -> {
|
||||
R|<local>/other|.R|/A.a|.R|/Base.baseFun|()
|
||||
R|<local>/other|.R|/A.a|.<Unresolved name: derivedFun>#()
|
||||
}
|
||||
}
|
||||
|
||||
when () {
|
||||
(R|<local>/other| is R|A.D|) -> {
|
||||
R|<local>/other|.R|/A.a|.R|/Base.baseFun|()
|
||||
R|<local>/other|.R|/A.a|.<Unresolved name: derivedFun>#()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public open class B : R|A| {
|
||||
public constructor(a: R|Derived|): R|A.B| {
|
||||
super<R|A|>()
|
||||
}
|
||||
|
||||
protected open override val a: R|Derived| = R|<local>/a|
|
||||
protected get(): R|Derived|
|
||||
|
||||
public final class Nested : R|kotlin/Any| {
|
||||
public constructor(): R|A.B.Nested| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun fest_3(other: R|A|): R|kotlin/Unit| {
|
||||
R|<local>/other|.R|/A.a|.R|/Base.baseFun|()
|
||||
when () {
|
||||
(R|<local>/other| is R|A.B|) -> {
|
||||
R|<local>/other|.R|/A.B.a|.R|/Base.baseFun|()
|
||||
R|<local>/other|.R|/A.B.a|.R|/Derived.derivedFun|()
|
||||
}
|
||||
}
|
||||
|
||||
when () {
|
||||
(R|<local>/other| is R|A.C|) -> {
|
||||
R|<local>/other|.R|/A.a|.R|/Base.baseFun|()
|
||||
R|<local>/other|.R|/A.a|.<Unresolved name: derivedFun>#()
|
||||
}
|
||||
}
|
||||
|
||||
when () {
|
||||
(R|<local>/other| is R|A.D|) -> {
|
||||
R|<local>/other|.R|/A.a|.R|/Base.baseFun|()
|
||||
R|<local>/other|.R|/A.a|.<Unresolved name: derivedFun>#()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final class C : R|A.B| {
|
||||
public constructor(a: R|Derived|): R|A.C| {
|
||||
super<R|A.B|>(R|<local>/a|)
|
||||
}
|
||||
|
||||
protected final override val a: R|Derived| = R|<local>/a|
|
||||
protected get(): R|Derived|
|
||||
|
||||
public final fun fest_4(other: R|A|): R|kotlin/Unit| {
|
||||
R|<local>/other|.R|/A.a|.R|/Base.baseFun|()
|
||||
when () {
|
||||
(R|<local>/other| is R|A.B|) -> {
|
||||
R|<local>/other|.R|/A.a|.R|/Base.baseFun|()
|
||||
R|<local>/other|.R|/A.a|.<Unresolved name: derivedFun>#()
|
||||
}
|
||||
}
|
||||
|
||||
when () {
|
||||
(R|<local>/other| is R|A.C|) -> {
|
||||
R|<local>/other|.R|/A.C.a|.R|/Base.baseFun|()
|
||||
R|<local>/other|.R|/A.C.a|.R|/Derived.derivedFun|()
|
||||
}
|
||||
}
|
||||
|
||||
when () {
|
||||
(R|<local>/other| is R|A.D|) -> {
|
||||
R|<local>/other|.R|/A.a|.R|/Base.baseFun|()
|
||||
R|<local>/other|.R|/A.a|.<Unresolved name: derivedFun>#()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final class D : R|A| {
|
||||
public constructor(a: R|Derived|): R|A.D| {
|
||||
super<R|A|>()
|
||||
}
|
||||
|
||||
protected final override val a: R|Derived| = R|<local>/a|
|
||||
protected get(): R|Derived|
|
||||
|
||||
public final fun fest_5(other: R|A|): R|kotlin/Unit| {
|
||||
R|<local>/other|.R|/A.a|.R|/Base.baseFun|()
|
||||
when () {
|
||||
(R|<local>/other| is R|A.B|) -> {
|
||||
R|<local>/other|.R|/A.a|.R|/Base.baseFun|()
|
||||
R|<local>/other|.R|/A.a|.<Unresolved name: derivedFun>#()
|
||||
}
|
||||
}
|
||||
|
||||
when () {
|
||||
(R|<local>/other| is R|A.C|) -> {
|
||||
R|<local>/other|.R|/A.a|.R|/Base.baseFun|()
|
||||
R|<local>/other|.R|/A.a|.<Unresolved name: derivedFun>#()
|
||||
}
|
||||
}
|
||||
|
||||
when () {
|
||||
(R|<local>/other| is R|A.D|) -> {
|
||||
R|<local>/other|.R|/A.D.a|.R|/Base.baseFun|()
|
||||
R|<local>/other|.R|/A.D.a|.R|/Derived.derivedFun|()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
// FIR_DUMP
|
||||
|
||||
interface Base {
|
||||
fun baseFun()
|
||||
}
|
||||
|
||||
interface Derived : Base {
|
||||
fun derivedFun()
|
||||
}
|
||||
|
||||
abstract class A {
|
||||
abstract protected val a: Base
|
||||
|
||||
fun fest_1(other: A) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.baseFun()
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.derivedFun()
|
||||
}
|
||||
if (other is C) {
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.baseFun()
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.derivedFun()
|
||||
}
|
||||
if (other is D) {
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.baseFun()
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.derivedFun()
|
||||
}
|
||||
}
|
||||
|
||||
open class B(override val a: Derived) : A() {
|
||||
class Nested {
|
||||
fun fest_3(other: A) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.a.baseFun()
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.a.derivedFun()
|
||||
}
|
||||
if (other is C) {
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.baseFun()
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.derivedFun()
|
||||
}
|
||||
if (other is D) {
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.baseFun()
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.derivedFun()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class C(override val a: Derived) : B(a) {
|
||||
fun fest_4(other: A) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.baseFun()
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.derivedFun()
|
||||
}
|
||||
if (other is C) {
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.a.baseFun()
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.a.derivedFun()
|
||||
}
|
||||
if (other is D) {
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.baseFun()
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.derivedFun()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class D(override val a: Derived) : A() {
|
||||
fun fest_5(other: A) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.baseFun()
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.derivedFun()
|
||||
}
|
||||
if (other is C) {
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.baseFun()
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.<!INVISIBLE_MEMBER!>a<!>.derivedFun()
|
||||
}
|
||||
if (other is D) {
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.a.baseFun()
|
||||
<!DEBUG_INFO_SMARTCAST!>other<!>.a.derivedFun()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
package
|
||||
|
||||
public abstract class A {
|
||||
public constructor A()
|
||||
protected abstract val a: Base
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun fest_1(/*0*/ other: A): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public open class B : A {
|
||||
public constructor B(/*0*/ a: Derived)
|
||||
protected open override /*1*/ val a: Derived
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun fest_1(/*0*/ other: A): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public final class Nested {
|
||||
public constructor Nested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun fest_3(/*0*/ other: A): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public final class C : A.B {
|
||||
public constructor C(/*0*/ a: Derived)
|
||||
protected open override /*1*/ val a: Derived
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun fest_1(/*0*/ other: A): kotlin.Unit
|
||||
public final fun fest_4(/*0*/ other: A): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class D : A {
|
||||
public constructor D(/*0*/ a: Derived)
|
||||
protected open override /*1*/ val a: Derived
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun fest_1(/*0*/ other: A): kotlin.Unit
|
||||
public final fun fest_5(/*0*/ other: A): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public interface Base {
|
||||
public abstract fun baseFun(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface Derived : Base {
|
||||
public abstract override /*1*/ /*fake_override*/ fun baseFun(): kotlin.Unit
|
||||
public abstract fun derivedFun(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
Vendored
+68
@@ -0,0 +1,68 @@
|
||||
// FIR_IDENTICAL
|
||||
interface Base {
|
||||
fun baseFun()
|
||||
}
|
||||
|
||||
abstract class A {
|
||||
abstract protected val a: Base
|
||||
|
||||
fun fest_1(other: A) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
if (other is C) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
if (other is D) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
}
|
||||
|
||||
open class B(override val a: Base) : A() {
|
||||
class Nested {
|
||||
fun fest_3(other: A) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
if (other is C) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
if (other is D) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class C(override val a: Base) : B(a) {
|
||||
fun fest_4(other: A) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
if (other is C) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
if (other is D) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class D(override val a: Base) : A() {
|
||||
fun fest_5(other: A) {
|
||||
other.a.baseFun() // OK
|
||||
if (other is B) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
if (other is C) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
if (other is D) {
|
||||
other.a.baseFun()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+55
@@ -0,0 +1,55 @@
|
||||
package
|
||||
|
||||
public abstract class A {
|
||||
public constructor A()
|
||||
protected abstract val a: Base
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun fest_1(/*0*/ other: A): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public open class B : A {
|
||||
public constructor B(/*0*/ a: Base)
|
||||
protected open override /*1*/ val a: Base
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun fest_1(/*0*/ other: A): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public final class Nested {
|
||||
public constructor Nested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun fest_3(/*0*/ other: A): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public final class C : A.B {
|
||||
public constructor C(/*0*/ a: Base)
|
||||
protected open override /*1*/ val a: Base
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun fest_1(/*0*/ other: A): kotlin.Unit
|
||||
public final fun fest_4(/*0*/ other: A): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class D : A {
|
||||
public constructor D(/*0*/ a: Base)
|
||||
protected open override /*1*/ val a: Base
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun fest_1(/*0*/ other: A): kotlin.Unit
|
||||
public final fun fest_5(/*0*/ other: A): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public interface Base {
|
||||
public abstract fun baseFun(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user