Use information from stub for contracts presence
This commit is contained in:
@@ -293,11 +293,11 @@ inline fun <reified T : KtElement, R> flatMapDescendantsOfTypeVisitor(
|
||||
|
||||
// ----------- Contracts -------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
fun KtElement.isContractPresentPsiCheck(): Boolean {
|
||||
val contractAllowedHere = this is KtNamedFunction &&
|
||||
isTopLevel &&
|
||||
hasBlockBody() &&
|
||||
!hasModifier(KtTokens.OPERATOR_KEYWORD)
|
||||
fun KtNamedFunction.isContractPresentPsiCheck(): Boolean {
|
||||
val contractAllowedHere =
|
||||
isTopLevel &&
|
||||
hasBlockBody() &&
|
||||
!hasModifier(KtTokens.OPERATOR_KEYWORD)
|
||||
if (!contractAllowedHere) return false
|
||||
|
||||
val firstExpression = ((this as? KtFunction)?.bodyExpression as? KtBlockExpression)?.statements?.firstOrNull() ?: return false
|
||||
|
||||
Reference in New Issue
Block a user