Skip to content

Commit

Permalink
Disable ExitOutsideMain if contextBinding is empty (#5127)
Browse files Browse the repository at this point in the history
  • Loading branch information
BraisGabin committed Jul 24, 2022
1 parent e4a2bf5 commit 569697c
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 569697c

Please sign in to comment.