Implement "Safe Delete" refactoring for type parameters
Conflicts: idea/src/org/jetbrains/jet/plugin/refactoring/safeDelete/KotlinSafeDeleteProcessor.java Conflicts: generators/org/jetbrains/jet/generators/tests/GenerateTests.java Conflicts: generators/org/jetbrains/jet/generators/tests/GenerateTests.java
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
class A<<caret>X, Y, Z> {
|
||||
fun foo(x: X) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
val a = A<Int, String, Any>()
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Type parameter X has 1 usage that is not safe to delete.
|
||||
Of those 0 usages are in strings, comments, or non-code files.
|
||||
@@ -0,0 +1,9 @@
|
||||
class A<X> {
|
||||
fun foo<<caret>Y>(x: X, y: Y) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun bar(a: A<String>) {
|
||||
a.foo<Int>("123", 123)
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Type parameter Y has 1 usage that is not safe to delete.
|
||||
Of those 0 usages are in strings, comments, or non-code files.
|
||||
@@ -0,0 +1,7 @@
|
||||
class A<<caret>X, Y: X, Z> {
|
||||
fun foo(x: X) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
val a = A<Int, String, Any>()
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Type parameter X has 2 usages that are not safe to delete.
|
||||
Of those 0 usages are in strings, comments, or non-code files.
|
||||
@@ -0,0 +1,4 @@
|
||||
class A<<caret>X, Y, Z> where Y: X {
|
||||
}
|
||||
|
||||
val a = A<Int, String, Any>()
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Type parameter X has 1 usage that is not safe to delete.
|
||||
Of those 0 usages are in strings, comments, or non-code files.
|
||||
@@ -0,0 +1,9 @@
|
||||
class A<<caret>X> {
|
||||
fun foo<Y, Z>() where Y: X {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun bar(a: A<Number>) {
|
||||
a.foo<Int, String>()
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Type parameter X has 1 usage that is not safe to delete.
|
||||
Of those 0 usages are in strings, comments, or non-code files.
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class A<out <caret>X: Comparable<X>, in Y: Number, Z>
|
||||
|
||||
val a = A<String, Int, Any>()
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class A<in Y: Number, Z>
|
||||
|
||||
val a = A<Int, Any>()
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class A<out X: Comparable<X>, in <caret>Y: Number, Z>
|
||||
|
||||
val a = A<String, Int, Any>()
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class A<out X: Comparable<X>, Z>
|
||||
|
||||
val a = A<String, Any>()
|
||||
@@ -0,0 +1,3 @@
|
||||
open class A<<caret>X, Y, Z>
|
||||
|
||||
class B<T, U>: A<T, String, U>
|
||||
@@ -0,0 +1,3 @@
|
||||
open class A<Y, Z>
|
||||
|
||||
class B<T, U>: A<String, U>
|
||||
@@ -0,0 +1,3 @@
|
||||
open class A<<caret>X, Y, Z>
|
||||
|
||||
class B<T, U>: A<String, T, U>
|
||||
@@ -0,0 +1,3 @@
|
||||
open class A<Y, Z>
|
||||
|
||||
class B<T, U>: A<T, U>
|
||||
@@ -0,0 +1,3 @@
|
||||
class A<<caret>X, Y, Z>
|
||||
|
||||
val a = A<Int, String, Any>()
|
||||
@@ -0,0 +1,3 @@
|
||||
class A<Y, Z>
|
||||
|
||||
val a = A<String, Any>()
|
||||
@@ -0,0 +1,3 @@
|
||||
class A<X, <caret>Y, Z>
|
||||
|
||||
val a = A<Int, String, Any>()
|
||||
@@ -0,0 +1,3 @@
|
||||
class A<X, Z>
|
||||
|
||||
val a = A<Int, Any>()
|
||||
@@ -0,0 +1,3 @@
|
||||
class A<X, Y, <caret>Z>
|
||||
|
||||
val a = A<Int, String, Any>()
|
||||
@@ -0,0 +1,3 @@
|
||||
class A<X, Y>
|
||||
|
||||
val a = A<Int, String>()
|
||||
@@ -0,0 +1,9 @@
|
||||
class A<X> {
|
||||
fun foo<<caret>Y, Z>() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun bar(a: A<String>) {
|
||||
a.foo<Int, Any>()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class A<X> {
|
||||
fun foo<Z>() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun bar(a: A<String>) {
|
||||
a.foo<Any>()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class A<X> {
|
||||
fun foo<Y, <caret>Z>() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun bar(a: A<String>) {
|
||||
a.foo<Int, Any>()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class A<X> {
|
||||
fun foo<Y>() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun bar(a: A<String>) {
|
||||
a.foo<Int>()
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
class A<<caret>X>
|
||||
|
||||
val a = A<Int>()
|
||||
@@ -0,0 +1,3 @@
|
||||
class A
|
||||
|
||||
val a = A()
|
||||
@@ -0,0 +1,9 @@
|
||||
class A<X> {
|
||||
fun foo<<caret>Y>() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun bar(a: A<String>) {
|
||||
a.foo<Int>()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class A<X> {
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun bar(a: A<String>) {
|
||||
a.foo()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
A<Int, String, Object> a = new A<Int, String, Object>()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class A<<caret>X, Y, Z> {
|
||||
fun foo(x: X) {
|
||||
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Type parameter X has 1 usage that is not safe to delete.
|
||||
Of those 0 usages are in strings, comments, or non-code files.
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class B {
|
||||
void bar(A<String> a) {
|
||||
a.<Int>foo("123", 123)
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class A<X> {
|
||||
fun foo<<caret>Y>(x: X, y: Y) {
|
||||
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Type parameter Y has 1 usage that is not safe to delete.
|
||||
Of those 0 usages are in strings, comments, or non-code files.
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
A<Int, String, Object> a = new A<Int, String, Object>()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class A<<caret>X, Y: X, Z> {
|
||||
fun foo(x: X) {
|
||||
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Type parameter X has 2 usages that are not safe to delete.
|
||||
Of those 0 usages are in strings, comments, or non-code files.
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
A<Int, String, Object> a = new A<Int, String, Object>()
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
class A<<caret>X, Y, Z> where Y: X {
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Type parameter X has 1 usage that is not safe to delete.
|
||||
Of those 0 usages are in strings, comments, or non-code files.
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class B {
|
||||
void bar(A<Number> a) {
|
||||
a.<Int, String>foo()
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class A<<caret>X> {
|
||||
fun foo<Y, Z>() where Y: X {
|
||||
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Type parameter X has 1 usage that is not safe to delete.
|
||||
Of those 0 usages are in strings, comments, or non-code files.
|
||||
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
A a = new A()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
A a = new A()
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
class A<<caret>X, Y, Z>
|
||||
+1
@@ -0,0 +1 @@
|
||||
class A<Y, Z>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
A<String, Int, Object> a = new A<String, Int, Object>()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
A<Int, Object> a = new A<Int, Object>()
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
class A<out <caret>X: Comparable<X>, in Y: Number, Z>
|
||||
+1
@@ -0,0 +1 @@
|
||||
class A<in Y: Number, Z>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
A<String, Int, Object> a = new A<String, Int, Object>()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
A<String, Object> a = new A<String, Object>()
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
class A<out X: Comparable<X>, in <caret>Y: Number, Z>
|
||||
+1
@@ -0,0 +1 @@
|
||||
class A<out X: Comparable<X>, Z>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class B<T, U> extends A<T, String, U> {
|
||||
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class B<T, U> extends A<String, U> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
open class A<<caret>X, Y, Z>
|
||||
+1
@@ -0,0 +1 @@
|
||||
open class A<Y, Z>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class B<T, U> extends A<String, T, U> {
|
||||
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class B<T, U> extends A<T, U> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
open class A<<caret>X, Y, Z>
|
||||
+1
@@ -0,0 +1 @@
|
||||
open class A<Y, Z>
|
||||
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
A<Int, String, Object> a = new A<Int, String, Object>()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
A<String, Object> a = new A<String, Object>()
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
class A<<caret>X, Y, Z>
|
||||
+1
@@ -0,0 +1 @@
|
||||
class A<Y, Z>
|
||||
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
A<Int, String, Object> a = new A<Int, String, Object>()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
A<Int, Object> a = new A<Int, Object>()
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
class A<X, <caret>Y, Z>
|
||||
+1
@@ -0,0 +1 @@
|
||||
class A<X, Z>
|
||||
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
A<Int, String, Object> a = new A<Int, String, Object>()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
A<Int, String> a = new A<Int, String>()
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
class A<X, Y, <caret>Z>
|
||||
+1
@@ -0,0 +1 @@
|
||||
class A<X, Y>
|
||||
@@ -0,0 +1,5 @@
|
||||
class B {
|
||||
void bar(A<String> a) {
|
||||
a.<Int, Object>foo()
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class B {
|
||||
void bar(A<String> a) {
|
||||
a.<Object>foo()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class A<X> {
|
||||
fun foo<<caret>Y, Z>() {
|
||||
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class A<X> {
|
||||
fun foo<Z>() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class B {
|
||||
void bar(A<String> a) {
|
||||
a.<Int, Object>foo()
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class B {
|
||||
void bar(A<String> a) {
|
||||
a.<Int>foo()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class A<X> {
|
||||
fun foo<Y, <caret>Z>() {
|
||||
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class A<X> {
|
||||
fun foo<Y>() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
A<Int> a = new A<Int>()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class B {
|
||||
A a = new A()
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
class A<<caret>X>
|
||||
+1
@@ -0,0 +1 @@
|
||||
class A
|
||||
@@ -0,0 +1,5 @@
|
||||
class B {
|
||||
void bar(A<String> a) {
|
||||
a.<Int>foo()
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class B {
|
||||
void bar(A<String> a) {
|
||||
a.foo()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class A<X> {
|
||||
fun foo<<caret>Y>() {
|
||||
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class A<X> {
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user