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:
Alexey Sedunov
2013-07-29 17:30:07 +04:00
parent 62a1a9b8d1
commit 203e80debe
102 changed files with 722 additions and 122 deletions
@@ -0,0 +1,7 @@
class A<<caret>X, Y, Z> {
fun foo(x: X) {
}
}
val a = A<Int, String, Any>()
@@ -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)
}
@@ -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>()
@@ -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>()
@@ -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>()
}
@@ -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 A<out <caret>X: Comparable<X>, in Y: Number, Z>
val a = A<String, Int, Any>()
@@ -0,0 +1,3 @@
class A<in Y: Number, Z>
val a = A<Int, Any>()
@@ -0,0 +1,3 @@
class A<out X: Comparable<X>, in <caret>Y: Number, Z>
val a = A<String, Int, Any>()
@@ -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()
}
@@ -0,0 +1,3 @@
class B {
A<Int, String, Object> a = new A<Int, String, Object>()
}
@@ -0,0 +1,5 @@
class A<<caret>X, Y, Z> {
fun foo(x: X) {
}
}
@@ -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,5 @@
class B {
void bar(A<String> a) {
a.<Int>foo("123", 123)
}
}
@@ -0,0 +1,5 @@
class A<X> {
fun foo<<caret>Y>(x: X, y: Y) {
}
}
@@ -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,3 @@
class B {
A<Int, String, Object> a = new A<Int, String, Object>()
}
@@ -0,0 +1,5 @@
class A<<caret>X, Y: X, Z> {
fun foo(x: X) {
}
}
@@ -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,3 @@
class B {
A<Int, String, Object> a = new A<Int, String, Object>()
}
@@ -0,0 +1,2 @@
class A<<caret>X, Y, Z> where Y: X {
}
@@ -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,5 @@
class B {
void bar(A<Number> a) {
a.<Int, String>foo()
}
}
@@ -0,0 +1,5 @@
class A<<caret>X> {
fun foo<Y, Z>() where Y: X {
}
}
@@ -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()
}
@@ -0,0 +1,3 @@
class B {
A a = new A()
}
@@ -0,0 +1 @@
class A<<caret>X, Y, Z>
@@ -0,0 +1,3 @@
class B {
A<String, Int, Object> a = new A<String, Int, Object>()
}
@@ -0,0 +1,3 @@
class B {
A<Int, Object> a = new A<Int, Object>()
}
@@ -0,0 +1 @@
class A<out <caret>X: Comparable<X>, in Y: Number, Z>
@@ -0,0 +1,3 @@
class B {
A<String, Int, Object> a = new A<String, Int, Object>()
}
@@ -0,0 +1,3 @@
class B {
A<String, Object> a = new A<String, Object>()
}
@@ -0,0 +1 @@
class A<out X: Comparable<X>, in <caret>Y: Number, Z>
@@ -0,0 +1 @@
class A<out X: Comparable<X>, Z>
@@ -0,0 +1,3 @@
class B<T, U> extends A<T, String, U> {
}
@@ -0,0 +1,3 @@
class B<T, U> extends A<String, U> {
}
@@ -0,0 +1 @@
open class A<<caret>X, Y, Z>
@@ -0,0 +1,3 @@
class B<T, U> extends A<String, T, U> {
}
@@ -0,0 +1,3 @@
class B<T, U> extends A<T, U> {
}
@@ -0,0 +1 @@
open class A<<caret>X, Y, Z>
@@ -0,0 +1,3 @@
class B {
A<Int, String, Object> a = new A<Int, String, Object>()
}
@@ -0,0 +1,3 @@
class B {
A<String, Object> a = new A<String, Object>()
}
@@ -0,0 +1 @@
class A<<caret>X, Y, Z>
@@ -0,0 +1,3 @@
class B {
A<Int, String, Object> a = new A<Int, String, Object>()
}
@@ -0,0 +1,3 @@
class B {
A<Int, Object> a = new A<Int, Object>()
}
@@ -0,0 +1 @@
class A<X, <caret>Y, Z>
@@ -0,0 +1,3 @@
class B {
A<Int, String, Object> a = new A<Int, String, Object>()
}
@@ -0,0 +1,3 @@
class B {
A<Int, String> a = new A<Int, String>()
}
@@ -0,0 +1 @@
class A<X, Y, <caret>Z>
@@ -0,0 +1,5 @@
class B {
void bar(A<String> a) {
a.<Int, Object>foo()
}
}
@@ -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>() {
}
}
@@ -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()
}
}
@@ -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>() {
}
}
@@ -0,0 +1,5 @@
class A<X> {
fun foo<Y>() {
}
}
@@ -0,0 +1,3 @@
class B {
A<Int> a = new A<Int>()
}
@@ -0,0 +1,3 @@
class B {
A a = new A()
}
@@ -0,0 +1 @@
class A<<caret>X>
@@ -0,0 +1,5 @@
class B {
void bar(A<String> a) {
a.<Int>foo()
}
}
@@ -0,0 +1,5 @@
class B {
void bar(A<String> a) {
a.foo()
}
}
@@ -0,0 +1,5 @@
class A<X> {
fun foo<<caret>Y>() {
}
}
@@ -0,0 +1,5 @@
class A<X> {
fun foo() {
}
}