FIR IDE: Add KtCallableSymbol abstraction

- It should incapsulate callable symbols like functions, properties
and constructors

Co-authored-by: Ilya Kirillov <ilya.kirillov@jetbrains.com>
This commit is contained in:
Roman Golyshev
2020-07-08 20:39:52 +03:00
committed by Ilya Kirillov
parent a4a2d92c08
commit df03e31b86
8 changed files with 24 additions and 11 deletions
@@ -16,7 +16,7 @@ interface KtScope : ValidityOwner {
fun getAllSymbols(): Sequence<KtSymbol>
fun getCallableSymbols(): Sequence<KtSymbol>
fun getCallableSymbols(): Sequence<KtCallableSymbol>
fun getClassClassLikeSymbols(): Sequence<KtClassLikeSymbol>
fun containsName(name: Name): Boolean
@@ -0,0 +1,8 @@
/*
* Copyright 2010-2020 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.idea.frontend.api.symbols
abstract class KtCallableSymbol : KtSymbol
@@ -7,7 +7,7 @@ package org.jetbrains.kotlin.idea.frontend.api.symbols
import org.jetbrains.kotlin.name.FqName
sealed class KtFunctionLikeSymbol : KtTypedSymbol, KtSymbolWithKind {
sealed class KtFunctionLikeSymbol : KtCallableSymbol(), KtTypedSymbol, KtSymbolWithKind {
abstract val valueParameters: List<KtParameterSymbol>
}
@@ -7,7 +7,7 @@ package org.jetbrains.kotlin.idea.frontend.api.symbols
import org.jetbrains.kotlin.name.FqName
abstract class KtVariableLikeSymbol : KtTypedSymbol, KtNamedSymbol, KtSymbolWithKind
abstract class KtVariableLikeSymbol : KtCallableSymbol(), KtTypedSymbol, KtNamedSymbol, KtSymbolWithKind
abstract class KtEnumEntrySymbol : KtVariableLikeSymbol() {
final override val symbolKind: KtSymbolKind get() = KtSymbolKind.MEMBER
@@ -29,6 +29,9 @@ interface KtPossibleExtensionSymbol {
val receiverType: KtType?
}
val KtCallableSymbol.isExtension: Boolean
get() = (this as? KtPossibleExtensionSymbol)?.isExtension == true
interface KtSymbolWithTypeParameters {
val typeParameters: List<KtTypeParameterSymbol>
}