Move ClassifierUsageChecker invocation lower in LazyTopDownAnalyzer
Invoking checkers right after resolution of qualified expressions is too early: DeprecatedClassifierUsageChecker tries to load the annotations of a referenced classifier to report deprecation, and that may result in building light classes for not yet analyzed declarations #KT-13954 Fixed
This commit is contained in:
@@ -17,4 +17,16 @@ fun useCompanion() {
|
||||
val <!UNUSED_VARIABLE!>x<!> = Another.<!DEPRECATION!>Companion<!>
|
||||
Another.<!DEPRECATION!>Companion<!>.use()
|
||||
<!DEPRECATION!>Another<!>.use()
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("Some")
|
||||
class Some {
|
||||
companion object {
|
||||
fun use() {}
|
||||
}
|
||||
}
|
||||
|
||||
fun some() {
|
||||
<!DEPRECATION!>Some<!>.use()
|
||||
<!DEPRECATION!>Some<!>.Companion.use()
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package
|
||||
|
||||
public fun first(): kotlin.Unit
|
||||
public fun some(): kotlin.Unit
|
||||
public fun useCompanion(): kotlin.Unit
|
||||
|
||||
public final class Another {
|
||||
@@ -18,3 +19,18 @@ public final class Another {
|
||||
public final fun use(): kotlin.Unit
|
||||
}
|
||||
}
|
||||
|
||||
@kotlin.Deprecated(message = "Some") public final class Some {
|
||||
public constructor Some()
|
||||
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 companion object Companion {
|
||||
private constructor Companion()
|
||||
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 final fun use(): kotlin.Unit
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user