Add constructors to KtScope
- KtClassLikeSymbol.primaryConstructor was removed - Constructors were removed from getCallableMembers because constructors has no name (or special name `<init>`) and previous implementation was incorrect - KtScope.getAllSymbols returns constructors as before. Before it was like this because of the incorrect implementation of getCallableMembers - getConstructors has sence only for class scope, for the rest cases it is empty
This commit is contained in:
@@ -26,11 +26,13 @@ interface KtScope : ValidityTokenOwner {
|
||||
sequence {
|
||||
yieldAll(getCallableSymbols())
|
||||
yieldAll(getClassifierSymbols())
|
||||
yieldAll(getConstructors())
|
||||
}
|
||||
}
|
||||
|
||||
fun getCallableSymbols(nameFilter: KtScopeNameFilter = { true }): Sequence<KtCallableSymbol>
|
||||
fun getClassifierSymbols(nameFilter: KtScopeNameFilter = { true }): Sequence<KtClassifierSymbol>
|
||||
fun getConstructors(): Sequence<KtConstructorSymbol>
|
||||
|
||||
fun containsName(name: Name): Boolean = withValidityAssertion {
|
||||
name in getCallableNames() || name in getClassifierNames()
|
||||
|
||||
-2
@@ -54,8 +54,6 @@ abstract class KtClassOrObjectSymbol : KtClassLikeSymbol(),
|
||||
|
||||
abstract val superTypes: List<KtTypeAndAnnotations>
|
||||
|
||||
abstract val primaryConstructor: KtConstructorSymbol?
|
||||
|
||||
abstract override fun createPointer(): KtSymbolPointer<KtClassOrObjectSymbol>
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user