Skip to content

Commit

Permalink
Disable ExitOutsideMain if contextBinding is empty (detekt#5127)
Browse files Browse the repository at this point in the history
  • Loading branch information
BraisGabin authored and VitalyVPinchuk committed Jul 25, 2022
1 parent e35e3ed commit 42d20b1
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -58,7 +58,7 @@ class ExitOutsideMain(config: Config = Config.empty) : Rule(config) {
override fun visitCallExpression(expression: KtCallExpression) {
super.visitCallExpression(expression)

if (context == BindingContext.EMPTY) return
if (bindingContext == BindingContext.EMPTY) return

if (expression.getStrictParentOfType<KtNamedFunction>()?.isMainFunction() == true) return
val fqName = expression.getResolvedCall(bindingContext)?.resultingDescriptor?.fqNameOrNull() ?: return
Expand Down

0 comments on commit 42d20b1

Please sign in to comment.