""".trimIndent())
myFixture.testHighlighting()
}
+
+ fun testPropagateToReceiver() {
+ myFixture.enableInspections(com.intellij.codeInspection.i18n.I18nInspection())
+ myFixture.configureByText("Foo.kt", """
+ public fun String.trimIndent(): String = this
+ fun foo(@org.jetbrains.annotations.NonNls <warning descr="[UNUSED_PARAMETER] Parameter 'message' is never used">message</warning>: String) { }
+ fun bar() {
+ foo("foo bar")
+ foo("foo bar".trimIndent())
+ }
+ """.trimIndent())
+ myFixture.testHighlighting()
+ }
fun testPropertyAssignment() {
val inspection = com.intellij.codeInspection.i18n.I18nInspection()
UExpression parent = expression;
while (true) {
UExpression next = ObjectUtils.tryCast(parent.getUastParent(), UExpression.class);
- if (next == null || next instanceof ULambdaExpression || next instanceof UReturnExpression) return parent;
- if (next instanceof USwitchClauseExpression || next instanceof UNamedExpression) return parent;
+ if (next == null ||
+ next instanceof ULambdaExpression ||
+ next instanceof UReturnExpression ||
+ next instanceof USwitchClauseExpression ||
+ next instanceof UNamedExpression) {
+ return parent;
+ }
if (next instanceof UPolyadicExpression && ((UPolyadicExpression)next).getOperator() != UastBinaryOperator.PLUS) return parent;
if (next instanceof UCallExpression) {
if (!UastExpressionUtils.isArrayInitializer(next) && !UastExpressionUtils.isNewArrayWithInitializer(next)) {