From e47561e70b01989a100e247574f7d47fcdc33146 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Wed, 3 May 2023 15:32:52 +0200 Subject: [PATCH] [FIR tests] do not distinguish builtins & library origins fir which is retrieved by LL symbol providers based on stubs, receives builtin origin when found in kotlin_builtins pure compiler providers found the same fir declarations in stdlib and thus receive Library origin to avoid splitting the testdata, let's ignore the difference --- .../kotlin/test/frontend/fir/handlers/FirScopeDumpHandler.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirScopeDumpHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirScopeDumpHandler.kt index 6bebeec9e3b..1f168691625 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirScopeDumpHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirScopeDumpHandler.kt @@ -7,6 +7,7 @@ package org.jetbrains.kotlin.test.frontend.fir.handlers import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.declarations.FirCallableDeclaration +import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin import org.jetbrains.kotlin.fir.declarations.FirRegularClass import org.jetbrains.kotlin.fir.render import org.jetbrains.kotlin.fir.renderer.FirRenderer @@ -141,7 +142,8 @@ class FirScopeDumpHandler(testServices: TestServices) : FirAnalysisHandler(testS } private fun SmartPrinter.printInfo(declaration: FirCallableDeclaration, scope: FirTypeScope, counter: SymbolCounter) { - print("[${declaration.origin}]: ") + val origin = declaration.origin.takeUnless { it == FirDeclarationOrigin.BuiltIns } ?: FirDeclarationOrigin.Library + print("[$origin]: ") val renderedDeclaration = FirRenderer.noAnnotationBodiesAccessorAndArguments().renderElementAsString(declaration).trim() print(renderedDeclaration) print(" from $scope")