[FIR] Discriminate abstract members when resolving on super

This commit is contained in:
Mikhail Glukhikh
2020-02-04 16:06:24 +03:00
parent 8e40782e7b
commit 0fa98ed635
10 changed files with 56 additions and 19 deletions
@@ -22,7 +22,7 @@ interface I {
class B : A(), I {
override val x: Int = 12345
override val y: Int = super.<!AMBIGUITY!>y<!>
override val y: Int = super.y
override fun foo(): Int {
super.foo()
@@ -30,7 +30,7 @@ class B : A(), I {
}
override fun bar() {
super.<!AMBIGUITY!>bar<!>()
super.bar()
}
override fun qux() {
@@ -15,7 +15,7 @@ class Test1 : C(), A {
// Abstract 'foo' defined in 'C' wins against non-abstract 'foo' defined in 'A',
// because 'C' is a subclass of 'A' (and 'C::foo' overrides 'A::foo'),
// even though 'A' is explicitly listed in supertypes list for 'D'.
super.<!AMBIGUITY!>foo<!>()
super.foo()
}
}
@@ -93,11 +93,12 @@ FILE fqName:<root> fileName:/implicitNotNullOnDelegatedImplementation.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JUnrelatedFoo'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K4 modality:FINAL visibility:public superTypes:[<root>.JUnrelatedFoo; <root>.IFoo]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.K4) returnType:IrErrorType
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.K4) returnType:kotlin.String?
$this: VALUE_PARAMETER name:<this> type:<root>.K4
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (): IrErrorType declared in <root>.K4'
ERROR_CALL 'Unresolved reference: <Ambiguity: foo, [/JUnrelatedFoo.foo, /IFoo.foo]>#' type=IrErrorType
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String? declared in <root>.K4'
CALL 'public open fun foo (): kotlin.String? [operator] declared in <root>.JUnrelatedFoo' type=kotlin.String? origin=null
$this: ERROR_CALL 'Unresolved reference: super<R|JUnrelatedFoo|R|IFoo|>' type=IrErrorType
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any