Best way to ignore variable in destructuring assignment


I have:

val (ignored, x) = functionThatReturnsPair()

Is there a way (e.g. naming convention) to avoid IntelliJ’s “Variable ‘ignored’ is never used” warning, without adding @Suppress("UNUSED_VARIABLE") to the method (it’s not accepted on the destructuring assignment)?


Not at this time. As far as I know, the plan is to allow using the underscore to mean that a destructuring component is unused, but we don’t have it scheduled for any specific version.