Callable references handled

This commit is contained in:
Valentin Kipyatkov
2016-08-28 23:39:42 +03:00
parent 6af9567527
commit 4cab04b24b
5 changed files with 62 additions and 0 deletions
@@ -314,6 +314,19 @@ private class Processor(
return true // companion object member or static member access - ignore it
}
}
is KtCallableReferenceExpression -> {
when (element) {
parent.receiverExpression -> { // usage in receiver of callable reference (before "::") - ignore it
return true
}
parent.callableReference -> { // usage after "::" in callable reference - should be reference to constructor of our data class
processSuspiciousExpression(element)
return true
}
}
}
}
if (element.getStrictParentOfType<KtImportDirective>() != null) return true // ignore usage in import