[FIR] By default, only hide members from mapped scope but not overrides

This affects methods like List.getFirst/getLast where it was decided
to keep them hidden but to make them visible on overrides like
ArrayList or LinkedList.
The goal is to prevent a breaking change since some implementations
like LinkedList had this method before JDK 21.

#KT-65438
This commit is contained in:
Kirill Rakhman
2024-02-02 18:20:47 +01:00
committed by Space Team
parent fbe8db4b45
commit fc6d25e50f
8 changed files with 45 additions and 50 deletions
@@ -146,7 +146,7 @@ class FirScopeDumpHandler(testServices: TestServices) : FirAnalysisHandler(testS
private fun SmartPrinter.printInfo(declaration: FirCallableDeclaration, scope: FirTypeScope, counter: SymbolCounter) {
val origin = declaration.origin.takeUnless { it == FirDeclarationOrigin.BuiltIns } ?: FirDeclarationOrigin.Library
print("[$origin]: ")
if (declaration.isHiddenEverywhereBesideSuperCalls == true) {
if (declaration.isHiddenEverywhereBesideSuperCalls != null) {
print("/* hidden beside supers */ ")
} else if (declaration.isHiddenToOvercomeSignatureClash == true) {
print("/* hidden due to clash */ ")