[SLC] do not create light classes for expect declarations
We shouldn't build expect declarations as they do not exist. We can omit check on member declarations as we won't request them as we skip expect classes ^KT-57536 Fixed
This commit is contained in:
committed by
Space Team
parent
c14c12479c
commit
7c8aff963f
+6
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2024 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.
|
||||
*/
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
|
||||
import org.jetbrains.kotlin.analysis.api.scopes.KtScope
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.*
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.markers.KtAnnotatedSymbol
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.markers.KtPossibleMultiplatformSymbol
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.markers.KtSymbolWithVisibility
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.pointers.symbolPointerOfType
|
||||
import org.jetbrains.kotlin.analysis.project.structure.KtModule
|
||||
@@ -90,6 +91,10 @@ internal class SymbolLightClassForFacade(
|
||||
if (callableSymbol !is KtFunctionSymbol && callableSymbol !is KtKotlinPropertySymbol) continue
|
||||
@Suppress("USELESS_IS_CHECK") // K2 warning suppression, TODO: KT-62472
|
||||
if (callableSymbol !is KtSymbolWithVisibility) continue
|
||||
|
||||
// We shouldn't materialize expect declarations
|
||||
@Suppress("USELESS_IS_CHECK") // K2 warning suppression, TODO: KT-62472
|
||||
if (callableSymbol is KtPossibleMultiplatformSymbol && callableSymbol.isExpect) continue
|
||||
if ((callableSymbol as? KtAnnotatedSymbol)?.hasInlineOnlyAnnotation() == true) continue
|
||||
if (multiFileClass && callableSymbol.toPsiVisibilityForMember() == PsiModifier.PRIVATE) continue
|
||||
if (callableSymbol.hasTypeForValueClassInSignature(ignoreReturnType = true)) continue
|
||||
|
||||
-1
@@ -216,7 +216,6 @@ internal fun SymbolLightClassBase.createMethods(
|
||||
fun KtAnalysisSession.handleDeclaration(declaration: KtCallableSymbol) {
|
||||
when (declaration) {
|
||||
is KtFunctionSymbol -> {
|
||||
// TODO: check if it has expect modifier
|
||||
if (declaration.hasReifiedParameters || declaration.isHiddenOrSynthetic()) return
|
||||
if (declaration.name.isSpecial) return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user