Back to Intellij Community

RemoveRedundantBackticks

plugins/kotlin/code-insight/descriptions/resources-en/inspectionDescriptions/RemoveRedundantBackticks.html

2025.3-rc-2790 B
Original Source

Reports redundant backticks in references.

Some of the Kotlin keywords are valid identifiers in Java, for example: in, object, is. If a Java library uses a Kotlin keyword for a method, you can still call the method escaping it with the backtick character (```), for example, foo.is(bar). Sometimes this escaping is redundant and can be safely omitted. The inspection discovers and reports such cases and is paired with the 'Remove redundant backticks' quick-fix, which allows you to amend the highlighted code.

Examples:

fun `is`(x: String) {}
  fun foo() {
      `is`("bar") // 'is' is a keyword, backticks are required
  }

  fun `test that smth works as designed`() {} // OK, complex identifier for readability improvement

  val `a` = 1 // no need for backticks