From 811e8d7c3b08be660685191d2c201f3d7179be33 Mon Sep 17 00:00:00 2001 From: Nikolay Lunyak Date: Tue, 30 Jan 2024 16:35:11 +0200 Subject: [PATCH] [FIR] Add more corner cases for KT-65058 ^KT-65058 --- .../tests/callingProtectedFromInline.fir.kt | 19 +++++++++++++++++++ .../tests/callingProtectedFromInline.kt | 8 +++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 compiler/testData/diagnostics/tests/callingProtectedFromInline.fir.kt diff --git a/compiler/testData/diagnostics/tests/callingProtectedFromInline.fir.kt b/compiler/testData/diagnostics/tests/callingProtectedFromInline.fir.kt new file mode 100644 index 00000000000..d9744cec6e9 --- /dev/null +++ b/compiler/testData/diagnostics/tests/callingProtectedFromInline.fir.kt @@ -0,0 +1,19 @@ +// ISSUE: KT-65058 + +open class A { + protected fun foo() { + } +} + +inline fun bar() = object : A() { + fun baz() { + foo() + this.foo() + + val receiver: A = this + receiver.foo() + + val receiver2 = this + receiver2.foo() + } +} diff --git a/compiler/testData/diagnostics/tests/callingProtectedFromInline.kt b/compiler/testData/diagnostics/tests/callingProtectedFromInline.kt index bfe9a97c751..05bb8b7a5d2 100644 --- a/compiler/testData/diagnostics/tests/callingProtectedFromInline.kt +++ b/compiler/testData/diagnostics/tests/callingProtectedFromInline.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL // ISSUE: KT-65058 open class A { @@ -9,5 +8,12 @@ open class A { inline fun bar() = object : A() { fun baz() { foo() + this.foo() + + val receiver: A = this + receiver.foo() + + val receiver2 = this + receiver2.foo() } }