From 8e40782e7b8d4b015c99161e30009cd7a6d5cb91 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Tue, 4 Feb 2020 15:15:45 +0300 Subject: [PATCH] [FIR] Add test with abstract / non-abstract ambiguity --- .../testData/resolve/problems/incorrectSuperCall.kt | 7 +++++++ .../testData/resolve/problems/incorrectSuperCall.txt | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/compiler/fir/resolve/testData/resolve/problems/incorrectSuperCall.kt b/compiler/fir/resolve/testData/resolve/problems/incorrectSuperCall.kt index 28cad076bb6..e2477c919c6 100644 --- a/compiler/fir/resolve/testData/resolve/problems/incorrectSuperCall.kt +++ b/compiler/fir/resolve/testData/resolve/problems/incorrectSuperCall.kt @@ -1,10 +1,14 @@ interface A { fun bar() {} + + fun baz() } open class B { open fun foo() {} open fun bar() {} + + open fun baz() {} } class C : A, B() { @@ -12,5 +16,8 @@ class C : A, B() { super.foo() super.bar() // should be ambiguity (NB: really we should have overridden bar in C) + + super.baz() // Ok + baz() // Ok } } diff --git a/compiler/fir/resolve/testData/resolve/problems/incorrectSuperCall.txt b/compiler/fir/resolve/testData/resolve/problems/incorrectSuperCall.txt index 41ae7ccb0fc..f77b0d9114d 100644 --- a/compiler/fir/resolve/testData/resolve/problems/incorrectSuperCall.txt +++ b/compiler/fir/resolve/testData/resolve/problems/incorrectSuperCall.txt @@ -3,6 +3,8 @@ FILE: incorrectSuperCall.kt public open fun bar(): R|kotlin/Unit| { } + public abstract fun baz(): R|kotlin/Unit| + } public open class B : R|kotlin/Any| { public constructor(): R|B| { @@ -15,6 +17,9 @@ FILE: incorrectSuperCall.kt public open fun bar(): R|kotlin/Unit| { } + public open fun baz(): R|kotlin/Unit| { + } + } public final class C : R|A|, R|B| { public constructor(): R|C| { @@ -24,6 +29,8 @@ FILE: incorrectSuperCall.kt public final override fun foo(): R|kotlin/Unit| { super.R|/B.foo|() super.#() + super.#() + this@R|/C|.R|/A.baz|() } }