FIR IDE: Search for the first non-local declaration in EnclosingDeclarationContext::detect
Local declarations do not have a stable `ClassId`, which is used in `declarationUtils.collectDesignation`. Local classes will always have `outerClassId.isLocal = true`, even when it is not true (see `org.jetbrains.kotlin.fir.builder.Context.currentClassId` for why this happens)
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
package test
|
||||
|
||||
class T
|
||||
|
||||
fun topLevelFun(param: T) {
|
||||
val firstVariable = T()
|
||||
|
||||
class LocalClass(constructorParam: T) {
|
||||
val localClassField = constructorParam
|
||||
|
||||
init {
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
|
||||
val secondVariable = T()
|
||||
}
|
||||
|
||||
// EXIST: firstVariable, param, constructorParam, localClassField
|
||||
// ABSENT: secondVariable
|
||||
Reference in New Issue
Block a user