ReplaceWith: don't keep class literal & callable reference in inlining
#KT-30197 Fixed
This commit is contained in:
@@ -333,6 +333,8 @@ class CodeInliner<TCallElement : KtElement>(
|
|||||||
usageCount
|
usageCount
|
||||||
) else true
|
) else true
|
||||||
is KtBinaryExpressionWithTypeRHS -> true
|
is KtBinaryExpressionWithTypeRHS -> true
|
||||||
|
is KtClassLiteralExpression -> false
|
||||||
|
is KtCallableReferenceExpression -> false
|
||||||
null -> false
|
null -> false
|
||||||
else -> true
|
else -> true
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+9
@@ -0,0 +1,9 @@
|
|||||||
|
// "Replace with 'bar(y)'" "true"
|
||||||
|
|
||||||
|
@Deprecated("", replaceWith = ReplaceWith("bar(y)"))
|
||||||
|
fun foo(x: Any, y: Any, z: Any) {
|
||||||
|
}
|
||||||
|
fun bar(y: Any) {}
|
||||||
|
fun main() {
|
||||||
|
<caret>foo(4::class, 42::dec, ::bar)
|
||||||
|
}
|
||||||
Vendored
+9
@@ -0,0 +1,9 @@
|
|||||||
|
// "Replace with 'bar(y)'" "true"
|
||||||
|
|
||||||
|
@Deprecated("", replaceWith = ReplaceWith("bar(y)"))
|
||||||
|
fun foo(x: Any, y: Any, z: Any) {
|
||||||
|
}
|
||||||
|
fun bar(y: Any) {}
|
||||||
|
fun main() {
|
||||||
|
bar(42::dec)
|
||||||
|
}
|
||||||
@@ -6065,6 +6065,11 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
|
|||||||
public void testStringTemplateUsedTwice2() throws Exception {
|
public void testStringTemplateUsedTwice2() throws Exception {
|
||||||
runTest("idea/testData/quickfix/deprecatedSymbolUsage/argumentSideEffects/stringTemplateUsedTwice2.kt");
|
runTest("idea/testData/quickfix/deprecatedSymbolUsage/argumentSideEffects/stringTemplateUsedTwice2.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("withLiteralAndReference.kt")
|
||||||
|
public void testWithLiteralAndReference() throws Exception {
|
||||||
|
runTest("idea/testData/quickfix/deprecatedSymbolUsage/argumentSideEffects/withLiteralAndReference.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("idea/testData/quickfix/deprecatedSymbolUsage/classUsages")
|
@TestMetadata("idea/testData/quickfix/deprecatedSymbolUsage/classUsages")
|
||||||
|
|||||||
Reference in New Issue
Block a user