Add more "Safe Delete" tests for value parameters
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
fun foo(n: Int, <caret>f: (Int) -> Unit) {
|
||||
println(n)
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
foo(10) { n -> println(n) }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
fun foo(n: Int) {
|
||||
println(n)
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
foo(10)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
fun String.foo(n: Int, <caret>f: (Int) -> Unit) {
|
||||
println(n)
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
"".foo(10) { n -> println(n) }
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
fun String.foo(n: Int) {
|
||||
println(n)
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
"".foo(10)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package test
|
||||
|
||||
class A(val <caret>name: String)
|
||||
|
||||
fun bar() {
|
||||
println(A("").name)
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
method A.getName() has 1 usage that is not safe to delete.
|
||||
@@ -0,0 +1,7 @@
|
||||
package test
|
||||
|
||||
class A(val <caret>name: String)
|
||||
|
||||
fun bar() {
|
||||
println(A(""))
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package test
|
||||
|
||||
class A()
|
||||
|
||||
fun bar() {
|
||||
println(A())
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test;
|
||||
|
||||
class A {
|
||||
void bar() {
|
||||
TestPackage.foo(
|
||||
10, new Function1<Integer, Unit>() {
|
||||
public Unit invoke(Integer n) {
|
||||
System.out.println(n);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test;
|
||||
|
||||
class A {
|
||||
void bar() {
|
||||
TestPackage.foo(
|
||||
10
|
||||
);
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
fun foo(n: Int, <caret>f: (Int) -> Unit) {
|
||||
println(n)
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
foo(10) { n -> println(n) }
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
fun foo(n: Int) {
|
||||
println(n)
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
foo(10)
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package test;
|
||||
|
||||
class A {
|
||||
void bar() {
|
||||
TestPackage.foo(
|
||||
"", 10, new Function1<Integer, Unit>() {
|
||||
public Unit invoke(Integer n) {
|
||||
System.out.println(n);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test;
|
||||
|
||||
class A {
|
||||
void bar() {
|
||||
TestPackage.foo(
|
||||
"", 10
|
||||
);
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
fun String.foo(n: Int, <caret>f: (Int) -> Unit) {
|
||||
println(n)
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
"".foo(10) { n -> println(n) }
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
fun String.foo(n: Int) {
|
||||
println(n)
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
"".foo(10)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package test;
|
||||
|
||||
class B {
|
||||
void bar() {
|
||||
System.out.println(new A("").getName());
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package test
|
||||
|
||||
class A(val <caret>name: String)
|
||||
|
||||
fun bar() {
|
||||
println(A("").name)
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
method A.getName() has 2 usages that are not safe to delete.
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package test;
|
||||
|
||||
class B {
|
||||
void bar() {
|
||||
System.out.println(new A(""));
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package test;
|
||||
|
||||
class B {
|
||||
void bar() {
|
||||
System.out.println(new A());
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package test
|
||||
|
||||
class A(val <caret>name: String)
|
||||
|
||||
fun bar() {
|
||||
println(A(""))
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package test
|
||||
|
||||
class A()
|
||||
|
||||
fun bar() {
|
||||
println(A())
|
||||
}
|
||||
@@ -798,6 +798,26 @@ public class JetSafeDeleteTestGenerated extends AbstractJetSafeDeleteTest {
|
||||
doValueParameterTest("idea/testData/safeDelete/deleteValueParameter/kotlinValueParameter/internalUsage2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaArg.kt")
|
||||
public void testLambdaArg() throws Exception {
|
||||
doValueParameterTest("idea/testData/safeDelete/deleteValueParameter/kotlinValueParameter/lambdaArg.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaArgExt.kt")
|
||||
public void testLambdaArgExt() throws Exception {
|
||||
doValueParameterTest("idea/testData/safeDelete/deleteValueParameter/kotlinValueParameter/lambdaArgExt.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertyParam1.kt")
|
||||
public void testPropertyParam1() throws Exception {
|
||||
doValueParameterTest("idea/testData/safeDelete/deleteValueParameter/kotlinValueParameter/propertyParam1.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertyParam2.kt")
|
||||
public void testPropertyParam2() throws Exception {
|
||||
doValueParameterTest("idea/testData/safeDelete/deleteValueParameter/kotlinValueParameter/propertyParam2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("safeUsages1.kt")
|
||||
public void testSafeUsages1() throws Exception {
|
||||
doValueParameterTest("idea/testData/safeDelete/deleteValueParameter/kotlinValueParameter/safeUsages1.kt");
|
||||
@@ -896,6 +916,16 @@ public class JetSafeDeleteTestGenerated extends AbstractJetSafeDeleteTest {
|
||||
doValueParameterTestWithJava("idea/testData/safeDelete/deleteValueParameter/kotlinValueParameterWithJava/internalUsage2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaArg.kt")
|
||||
public void testLambdaArg() throws Exception {
|
||||
doValueParameterTestWithJava("idea/testData/safeDelete/deleteValueParameter/kotlinValueParameterWithJava/lambdaArg.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaArgExt.kt")
|
||||
public void testLambdaArgExt() throws Exception {
|
||||
doValueParameterTestWithJava("idea/testData/safeDelete/deleteValueParameter/kotlinValueParameterWithJava/lambdaArgExt.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mixedHierarchy1.kt")
|
||||
public void testMixedHierarchy1() throws Exception {
|
||||
doValueParameterTestWithJava("idea/testData/safeDelete/deleteValueParameter/kotlinValueParameterWithJava/mixedHierarchy1.kt");
|
||||
@@ -926,6 +956,16 @@ public class JetSafeDeleteTestGenerated extends AbstractJetSafeDeleteTest {
|
||||
doValueParameterTestWithJava("idea/testData/safeDelete/deleteValueParameter/kotlinValueParameterWithJava/mixedHierarchyWithUnsafeUsages3.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertyParam1.kt")
|
||||
public void testPropertyParam1() throws Exception {
|
||||
doValueParameterTestWithJava("idea/testData/safeDelete/deleteValueParameter/kotlinValueParameterWithJava/propertyParam1.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertyParam2.kt")
|
||||
public void testPropertyParam2() throws Exception {
|
||||
doValueParameterTestWithJava("idea/testData/safeDelete/deleteValueParameter/kotlinValueParameterWithJava/propertyParam2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("safeUsages1.kt")
|
||||
public void testSafeUsages1() throws Exception {
|
||||
doValueParameterTestWithJava("idea/testData/safeDelete/deleteValueParameter/kotlinValueParameterWithJava/safeUsages1.kt");
|
||||
|
||||
Reference in New Issue
Block a user