[FIR IDE] Compare error types consistently in test data
Use the fixed error type description so test data can be shared across both frontends.
This commit is contained in:
+3
-1
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.analysis.api.impl.base.test.components
|
|||||||
import org.jetbrains.kotlin.analysis.api.impl.barebone.test.FrontendApiTestConfiguratorService
|
import org.jetbrains.kotlin.analysis.api.impl.barebone.test.FrontendApiTestConfiguratorService
|
||||||
import org.jetbrains.kotlin.analysis.api.impl.barebone.test.expressionMarkerProvider
|
import org.jetbrains.kotlin.analysis.api.impl.barebone.test.expressionMarkerProvider
|
||||||
import org.jetbrains.kotlin.analysis.api.impl.base.test.test.framework.AbstractHLApiSingleFileTest
|
import org.jetbrains.kotlin.analysis.api.impl.base.test.test.framework.AbstractHLApiSingleFileTest
|
||||||
|
import org.jetbrains.kotlin.analysis.api.symbols.DebugSymbolRenderer
|
||||||
import org.jetbrains.kotlin.psi.KtExpression
|
import org.jetbrains.kotlin.psi.KtExpression
|
||||||
import org.jetbrains.kotlin.psi.KtFile
|
import org.jetbrains.kotlin.psi.KtFile
|
||||||
import org.jetbrains.kotlin.test.model.TestModule
|
import org.jetbrains.kotlin.test.model.TestModule
|
||||||
@@ -24,7 +25,8 @@ abstract class AbstractExpectedExpressionTypeTest(
|
|||||||
|
|
||||||
val actualExpectedTypeText: String? = executeOnPooledThreadInReadAction {
|
val actualExpectedTypeText: String? = executeOnPooledThreadInReadAction {
|
||||||
analyseForTest(expressionAtCaret) {
|
analyseForTest(expressionAtCaret) {
|
||||||
expressionAtCaret.getExpectedType()?.asStringForDebugging()
|
val expectedType = expressionAtCaret.getExpectedType() ?: return@analyseForTest null
|
||||||
|
DebugSymbolRenderer.renderType(expectedType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -21,9 +21,9 @@ import kotlin.reflect.full.declaredMemberExtensionProperties
|
|||||||
import kotlin.reflect.full.extensionReceiverParameter
|
import kotlin.reflect.full.extensionReceiverParameter
|
||||||
|
|
||||||
public object DebugSymbolRenderer {
|
public object DebugSymbolRenderer {
|
||||||
public fun render(symbol: KtSymbol): String = Block().apply {
|
public fun render(symbol: KtSymbol): String = Block().apply { renderSymbol(symbol) }.toString()
|
||||||
renderSymbol(symbol)
|
|
||||||
}.toString()
|
public fun renderType(type: KtType): String = Block().apply { renderType(type) }.toString()
|
||||||
|
|
||||||
public fun KtAnalysisSession.renderExtra(symbol: KtSymbol): String = Block().apply {
|
public fun KtAnalysisSession.renderExtra(symbol: KtSymbol): String = Block().apply {
|
||||||
renderSymbol(symbol)
|
renderSymbol(symbol)
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
expression: av
|
expression: av
|
||||||
expected type: ERROR CLASS: Unresolved name: av
|
expected type: ERROR_TYPE
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
expression: av
|
expression: av
|
||||||
expected type: ERROR CLASS: Unresolved name: av
|
expected type: ERROR_TYPE
|
||||||
|
|||||||
Reference in New Issue
Block a user