Annotations supported

#KT-8912 Fixed
This commit is contained in:
Valentin Kipyatkov
2015-09-01 23:22:39 +03:00
parent 366204da85
commit 6575fb8535
15 changed files with 160 additions and 16 deletions
@@ -0,0 +1,10 @@
// "Replace with 'test.Bar'" "true"
package test
@deprecated("Replace with bar", ReplaceWith("test.Bar"))
annotation class Foo
annotation class Bar
@Foo<caret> class C {}
@@ -0,0 +1,10 @@
// "Replace with 'test.Bar'" "true"
package test
@deprecated("Replace with bar", ReplaceWith("test.Bar"))
annotation class Foo
annotation class Bar
@Bar class C {}
@@ -0,0 +1,10 @@
// "Replace with 'test.Bar'" "true"
package test
@deprecated("Replace with bar", ReplaceWith("test.Bar"))
annotation class Foo(val p1: String, val p2: Int)
annotation class Bar(val p1: String, val p2: Int)
@Foo<caret>("", 1) class C {}
@@ -0,0 +1,10 @@
// "Replace with 'test.Bar'" "true"
package test
@deprecated("Replace with bar", ReplaceWith("test.Bar"))
annotation class Foo(val p1: String, val p2: Int)
annotation class Bar(val p1: String, val p2: Int)
@Bar("", 1) class C {}
@@ -0,0 +1,8 @@
package dependency
@deprecated("", ReplaceWith("dependency.NewAnnotation"))
annotation class OldAnnotation(val p: Int = 0)
annotation class NewAnnotation(val p: Int = 0, val newP: String = "")
@NewAnnotation class C
@@ -0,0 +1,9 @@
// "Replace with 'test.Bar'" "true"
package x
import dependency.*
annotation class A(val a: NewAnnotation)
@A(NewAnnotation()) class Y
@@ -0,0 +1,10 @@
// "Replace usages of 'OldAnnotation' in whole project" "true"
package test
import dependency.NewAnnotation
fun foo(a: NewAnnotation) {
}
@NewAnnotation(1) class X
@@ -0,0 +1,8 @@
package dependency
@deprecated("", ReplaceWith("dependency.NewAnnotation"))
annotation class OldAnnotation(val p: Int = 0)
annotation class NewAnnotation(val p: Int = 0, val newP: String = "")
@OldAnnotation class C
@@ -0,0 +1,10 @@
// "Replace usages of 'OldAnnotation' in whole project" "true"
package test
import dependency.OldAnnotation
fun foo(a: OldAnnotation) {
}
@<caret>OldAnnotation(1) class X
@@ -0,0 +1,9 @@
// "Replace with 'test.Bar'" "true"
package x
import dependency.*
annotation class A(val a: OldAnnotation)
@A(OldAnnotation()) class Y