[FIR] Allow resolve to private members from debugger evaluator

KT-60714
This commit is contained in:
Alexey Merkulov
2023-07-31 20:28:59 +02:00
committed by Space Team
parent 1714fb71c8
commit e4ae15b3f0
16 changed files with 124 additions and 4 deletions
@@ -0,0 +1,3 @@
Local[name: a; isMutated: false; displayText: a]
a: R|A|
R|A|
@@ -0,0 +1,2 @@
// Need to choose public foo(Any) call instead of more specific but private call foo(Int)
a.foo(5)
@@ -0,0 +1,14 @@
MODULE_FRAGMENT name:<Sources of main>
FILE fqName:<root> fileName:/fragment.kt
CLASS CLASS name:CodeFragment modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.CodeFragment
CONSTRUCTOR visibility:public <> () returnType:<root>.CodeFragment [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
FUN name:run visibility:public modality:FINAL <> (p0:<root>.A) returnType:kotlin.Int
VALUE_PARAMETER name:p0 index:0 type:<root>.A
EXPRESSION_BODY
BLOCK type=kotlin.Int origin=null
CALL 'public final fun foo (x: kotlin.Any): kotlin.Int declared in <root>.A' type=kotlin.Int origin=null
$this: GET_VAR 'p0: <root>.A declared in <root>.CodeFragment.run' type=<root>.A origin=null
x: CONST Int type=kotlin.Int value=5
@@ -0,0 +1,8 @@
class A {
private fun foo(x: Int) = 1 + x
fun foo(x: Any) = 2
}
fun test(a: A) {
<caret>val x = 0
}
@@ -0,0 +1,5 @@
public final class CodeFragment {
// source: 'fragment.kt'
public method <init>(): void
public final static method run(p0: A): int
}
@@ -0,0 +1,3 @@
Local[name: a; isMutated: false; displayText: a]
a: R|A|
R|A|
@@ -0,0 +1,13 @@
MODULE_FRAGMENT name:<Sources of main>
FILE fqName:<root> fileName:/fragment.kt
CLASS CLASS name:CodeFragment modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.CodeFragment
CONSTRUCTOR visibility:public <> () returnType:<root>.CodeFragment [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
FUN name:run visibility:public modality:FINAL <> (p0:<root>.A) returnType:kotlin.Int
VALUE_PARAMETER name:p0 index:0 type:<root>.A
EXPRESSION_BODY
BLOCK type=kotlin.Int origin=null
CALL 'private final fun foo (): kotlin.Int declared in <root>.A' type=kotlin.Int origin=null
$this: GET_VAR 'p0: <root>.A declared in <root>.CodeFragment.run' type=<root>.A origin=null
@@ -0,0 +1,7 @@
class A {
private fun foo() = 2
}
fun test(a: A) {
<caret>val x = 0
}
@@ -0,0 +1,5 @@
public final class CodeFragment {
// source: 'fragment.kt'
public method <init>(): void
public final static method run(p0: A): int
}