[Low Level FIR] fix exception when creating symbol by invalid code
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols
|
||||
|
||||
import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.expressionMarkerProvider
|
||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
|
||||
abstract class AbstractSingleSymbolByPsi : AbstractSymbolTest() {
|
||||
override fun KtAnalysisSession.collectSymbols(ktFile: KtFile, testServices: TestServices): SymbolsData {
|
||||
val declaration = testServices.expressionMarkerProvider.getSelectedElementOfType<KtDeclaration>(ktFile)
|
||||
val symbol = declaration.getSymbol()
|
||||
return SymbolsData(listOf(symbol))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user