Support deprecation level HIDDEN for classifiers

Classifiers annotated with `@Deprecated(level = HIDDEN)` now have smaller
priority in imports, similarly to private classes. For example, if two
classifiers named Foo are imported with a star import and one of them is
deprecated-hidden, the name Foo in the source code is resolved to the other
one.

Also a minor change in multi-module diagnostic tests: do not append newlines
after the last module in the test

 #KT-13926 Fixed
This commit is contained in:
Alexander Udalov
2016-09-21 10:49:19 +03:00
parent 83c86d06ed
commit aaeae8b948
10 changed files with 271 additions and 5 deletions
@@ -0,0 +1,11 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE
@Deprecated("", level = DeprecationLevel.HIDDEN)
open class Foo
fun test(f: <!DEPRECATION_ERROR!>Foo<!>) {
f.toString()
val g: <!DEPRECATION_ERROR!>Foo<!>? = <!UNRESOLVED_REFERENCE!>Foo<!>()
}
class Bar : <!UNRESOLVED_REFERENCE, DEPRECATION_ERROR, DEBUG_INFO_UNRESOLVED_WITH_TARGET!>Foo<!>()
@@ -0,0 +1,17 @@
package
public fun test(/*0*/ f: Foo): kotlin.Unit
public final class Bar : Foo {
public constructor Bar()
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
}
@kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "") public open 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
}