Highlight references to deprecated things accordingly

#KT-2925 Fixed
This commit is contained in:
Natalia.Ukhorskaya
2012-10-12 15:23:04 +04:00
parent 2f2941fe5b
commit 20352b3810
17 changed files with 625 additions and 0 deletions
@@ -0,0 +1,15 @@
package test
<info>import</info> java.util.ArrayList
Deprecated <info>open</info> class MyClass {}
fun test() {
val a : <info descr="'test.MyClass' is deprecated">MyClass</info>? = null
val b = <info descr="'test.MyClass' is deprecated">MyClass</info>()
val c = ArrayList<<info descr="'test.MyClass' is deprecated">MyClass</info>>()
}
class Test(): <info descr="'test.MyClass' is deprecated">MyClass</info>() {}
class Test2(param: <info descr="'test.MyClass' is deprecated">MyClass</info>) {}
@@ -0,0 +1,19 @@
fun test() {
<info descr="'MyClass.<class-object-for-MyClass>' is deprecated">MyClass</info>.test
MyClass()
val a: MyClass? = null
val b: MyTrait? = null
<info descr="'MyTrait.<class-object-for-MyTrait>' is deprecated">MyTrait</info>.test
}
class MyClass(): MyTrait {
Deprecated class object {
val <info>test</info>: String = ""
}
}
trait MyTrait {
Deprecated class object {
val <info>test</info>: String = ""
}
}
@@ -0,0 +1,18 @@
fun test() {
<info descr="'fun test1()' is deprecated">test1</info>()
MyClass().<info descr="'fun test2()' is deprecated">test2</info>()
MyClass.<info descr="'fun test3()' is deprecated">test3</info>()
<info descr="'fun test4(x : jet.Int, y : jet.Int)' is deprecated">test4</info>(1, 2)
}
Deprecated fun test1() { }
Deprecated fun test4(x: Int, y: Int) { }
class MyClass() {
Deprecated fun test2() {}
class object {
Deprecated fun test3() {}
}
}
@@ -0,0 +1,10 @@
class MyClass {}
Deprecated fun MyClass.get(i: MyClass): MyClass { return MyClass() }
fun test() {
val x1 = MyClass()
val x2 = MyClass()
<info descr="'fun get(i : MyClass)' is deprecated">x1[x2]</info>
}
@@ -0,0 +1,19 @@
fun test() {
val c = MyClass()
c.<info descr="'getter for test1' is deprecated">test1</info>
c.<info descr="'getter for test2' is deprecated">test2</info>
c.test2 = ""
c.<info descr="'val test3' is deprecated">test3</info>
}
class MyClass() {
<info>public</info> val <info>test1</info>: String = ""
[Deprecated] <info descr="null">get</info>
<info>public</info> var <info>test2</info>: String = ""
[Deprecated] <info descr="null">get</info>
Deprecated <info>public</info> val <info>test3</info>: String = ""
[Deprecated] <info>get</info>
}
@@ -0,0 +1,8 @@
class MyClass {}
Deprecated fun MyClass.inc(): MyClass { return MyClass() }
fun test() {
var x3 = MyClass()
x3<info descr="'fun inc()' is deprecated">++</info>
}
@@ -0,0 +1,9 @@
class MyRunnable() {}
Deprecated fun MyRunnable.invoke() {
}
fun test() {
val m = MyRunnable()
<info descr="'fun invoke()' is deprecated">m()</info>
}
@@ -0,0 +1,36 @@
class MyClass {}
Deprecated fun MyClass.minus(i: MyClass) { }
Deprecated fun MyClass.div(i: MyClass) { }
Deprecated fun MyClass.times(i: MyClass) { }
Deprecated fun MyClass.not() { }
Deprecated fun MyClass.plus() { }
Deprecated fun MyClass.contains(i: MyClass): Boolean { return false }
Deprecated fun MyClass.plusAssign(i: MyClass) { }
Deprecated fun MyClass.equals(i: Any?): Boolean { return false }
Deprecated fun MyClass.compareTo(i: MyClass): Int { return 0 }
fun test() {
val x1 = MyClass()
val x2 = MyClass()
x1 <info descr="'fun minus(i : MyClass)' is deprecated">-</info> x2
x1 <info descr="'fun div(i : MyClass)' is deprecated">/</info> x2
x1 <info descr="'fun times(i : MyClass)' is deprecated">*</info> x2
<info descr="'fun not()' is deprecated">!</info>x1
<info descr="'fun plus()' is deprecated">+</info>x1
x1 <info descr="'fun contains(i : MyClass)' is deprecated">in</info> x2
x1 <info descr="'fun contains(i : MyClass)' is deprecated">!in</info> x2
x1 <info descr="'fun plusAssign(i : MyClass)' is deprecated">+=</info> x2
x1 <info descr="'fun equals(i : jet.Any?)' is deprecated">==</info> x2
x1 <info descr="'fun equals(i : jet.Any?)' is deprecated">!=</info> x2
x1 <info descr="'fun compareTo(i : MyClass)' is deprecated">></info> x2
}
@@ -0,0 +1,22 @@
fun test() {
<info descr="'val test1' is deprecated">test1</info>
MyClass().<info descr="'val test2' is deprecated">test2</info>
MyClass.<info descr="'val test3' is deprecated">test3</info>
<info descr="'var test4' is deprecated">test4</info>
MyClass().<info descr="'var test5' is deprecated">test5</info>
MyClass.<info descr="'var test6' is deprecated">test6</info>
}
Deprecated val <info>test1</info>: String = ""
Deprecated var <info>test4</info>: String = ""
class MyClass() {
Deprecated val <info>test2</info>: String = ""
Deprecated var <info>test5</info>: String = ""
class object {
Deprecated val <info>test3</info>: String = ""
Deprecated var <info>test6</info>: String = ""
}
}
@@ -0,0 +1,15 @@
class MyClass { }
Deprecated fun MyClass.rangeTo(i: MyClass): IntIterator {
throw Exception()
}
fun test() {
val x1 = MyClass()
val x2 = MyClass()
for (i in x1<info descr="'fun rangeTo(i : MyClass)' is deprecated">..</info>x2) {
}
}
@@ -0,0 +1,26 @@
fun test() {
MyClass().test1
MyClass().<info descr="'setter for test1' is deprecated">test1</info> = 0
MyClass().<info descr="'setter for test1' is deprecated">test1</info>++
MyClass().<info descr="'setter for test1' is deprecated">test1</info>--
++MyClass().<info descr="'setter for test1' is deprecated">test1</info>
--MyClass().<info descr="'setter for test1' is deprecated">test1</info>
MyClass().<info descr="'setter for test1' is deprecated">test1</info> += 1
MyClass().<info descr="'setter for test1' is deprecated">test1</info> -= 1
MyClass().<info descr="'setter for test1' is deprecated">test1</info> /= 1
MyClass().<info descr="'setter for test1' is deprecated">test1</info> *= 1
test2
<info descr="'setter for test2' is deprecated">test2</info> = 10
}
class MyClass() {
<info>public</info> var <info>test1</info>: Int = 0
[Deprecated] <info>set</info>
}
<info>public</info> var <info>test2</info>: Int = 0
[Deprecated] <info>set</info>
@@ -0,0 +1,9 @@
class MyClass(): Base() {
fun test2() {
super.test1()
}
}
<info>open</info> class Base() {
fun test1() {}
}
@@ -0,0 +1,10 @@
Deprecated trait MyTrait { }
fun test() {
val a: <info descr="'MyTrait' is deprecated">MyTrait</info>? = null
val b: List<<info descr="'MyTrait' is deprecated">MyTrait</info>>? = null
}
class Test(): <info descr="'MyTrait' is deprecated">MyTrait</info> { }
class Test2(param: <info descr="'MyTrait' is deprecated">MyTrait</info>) {}