Report deprecation on usage of type alias expanded to a deprecated class

#KT-15243 Fixed
This commit is contained in:
Dmitry Petrov
2017-05-17 16:04:29 +03:00
parent a2db4dc0d5
commit c1ef0bfcdb
6 changed files with 56 additions and 8 deletions
@@ -8,7 +8,10 @@ open class WithDeprecatedCtor(val x: Int) {
typealias DeprecatedClassAlias = <!DEPRECATION!>DeprecatedClass<!>
typealias WithDeprecatedCtorAlias = WithDeprecatedCtor
typealias ArrayListOfDeprecatedClass = ArrayList<<!DEPRECATION!>DeprecatedClass<!>>
class Test1 : <!DEPRECATION!>DeprecatedClassAlias<!>()
class Test2 : <!DEPRECATION!>WithDeprecatedCtorAlias<!>()
class Test2 : <!DEPRECATION!>WithDeprecatedCtorAlias<!>()
val test3 = <!DEPRECATION!>ArrayListOfDeprecatedClass<!>()
@@ -1,5 +1,7 @@
package
public val test3: ArrayListOfDeprecatedClass /* = java.util.ArrayList<DeprecatedClass> */
@kotlin.Deprecated(message = "Deprecated class") public open class DeprecatedClass {
public constructor DeprecatedClass()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@@ -30,5 +32,6 @@ public open class WithDeprecatedCtor {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public typealias ArrayListOfDeprecatedClass = kotlin.collections.ArrayList<DeprecatedClass>
public typealias DeprecatedClassAlias = DeprecatedClass
public typealias WithDeprecatedCtorAlias = WithDeprecatedCtor
@@ -0,0 +1,10 @@
@Deprecated("")
class Foo
typealias Test1 = <!DEPRECATION!>Foo<!>
typealias Test2 = List<<!DEPRECATION!>Foo<!>>
typealias Test3 = List<<!DEPRECATION!>Test2<!>>
fun use1(b: <!DEPRECATION!>Test1<!>) = b
fun use2(b: <!DEPRECATION!>Test2<!>) = b
fun use3(b: <!DEPRECATION!>Test3<!>) = b
@@ -0,0 +1,15 @@
package
public fun use1(/*0*/ b: Test1 /* = Foo */): Test1 /* = Foo */
public fun use2(/*0*/ b: Test2 /* = kotlin.collections.List<Foo> */): Test2 /* = kotlin.collections.List<Foo> */
public fun use3(/*0*/ b: Test3 /* = kotlin.collections.List<Test2 /* = kotlin.collections.List<Foo> */> */): Test3 /* = kotlin.collections.List<Test2 /* = kotlin.collections.List<Foo> */> */
@kotlin.Deprecated(message = "") public final class Foo {
public constructor Foo()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public typealias Test1 = Foo
public typealias Test2 = kotlin.collections.List<Foo>
public typealias Test3 = kotlin.collections.List<Test2>