Skip to content

Piranha hangs infinitely when removing a feature flag from Kotlin closure #701

Description

@daveight
class Sample {
   val lambda1 = {
      val x = featureService.isEnabled(STALE_FLAG)
      print(x)
   }
   val lambda2 = {
      val x = featureService.isEnabled(STALE_FLAG)
      print(x)
   }
   val lambda3 = {
      val x = featureService.isEnabled(STALE_FLAG)
      print(x)
   }
}

"stale_flag_name" => "STALE_FLAG"
"treated" => "true"

rules:

(call_expression
    (navigation_expression
      (simple_identifier)
      (navigation_suffix
        (simple_identifier) @fn_name
      )
    )
    (call_suffix
      (value_arguments
        (value_argument
           (simple_identifier) @flag_name
        )
     )
  )
) @call_expression
(#eq? @fn_name "isEnabled")
(#eq? @flag_name "@stale_flag_name")

Expected result:

class Sample {
   val lambda1 = {
      print(true)
   }
   val lambda2 = {
      print(true)
   }
   val lambda3 = {
      print(true)
   }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions