Introduce Type Alias: Support type constructor extraction
This commit is contained in:
@@ -466,4 +466,9 @@ fun KtElement.containingClass(): KtClass? = getStrictParentOfType<KtClass>()
|
||||
fun KtClassOrObject.findPropertyByName(name: String): KtNamedDeclaration? {
|
||||
return declarations.firstOrNull { it is KtProperty && it.name == name } as KtNamedDeclaration?
|
||||
?: getPrimaryConstructorParameters().firstOrNull { it.hasValOrVar() && it.name == name }
|
||||
}
|
||||
|
||||
fun isTypeConstructorReference(e: PsiElement): Boolean {
|
||||
val parent = e.parent
|
||||
return parent is KtUserType && parent.referenceExpression == e
|
||||
}
|
||||
Reference in New Issue
Block a user