You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@ParameterizedTest
@MethodSource("cases")
fun`with unnecessary parentheses on aval assignment`(testCase:RuleTestCase) {
val code ="""val a = if ("foo" in (null ?: "")) 1 else 2"""
assertThat(testCase.rule.lint(code)).hasSize(0)
}
But the issue seems to be in KtPsiUtil.areParenthesesUseless. I imagine that this will be solved in the compiler and we will be able to use the fix. But I'm not sure where to report this to be sure that this is fixed.
#4881 would be used as a workaround to this issue if you enable allowForUnclearPrecedence. But that's not released yet and as I said, it's just a workaround.
The following snippet triggers the
UnnecessaryParentheses
rule:However, they're not in fact unnecessary:
Your Environment
The text was updated successfully, but these errors were encountered: