Render original descriptor in the deprecation warning

Otherwise it gets confusing when multiple instantiations of the same deprecated
symbol (e.g. javaClass<T>()) are diagnosed with different type arguments
This commit is contained in:
Alexander Udalov
2015-08-26 16:41:16 +03:00
parent 8d9618348d
commit 2a93629305
@@ -90,9 +90,9 @@ public class DeprecatedSymbolValidator : SymbolUsageValidator {
private fun createDeprecationDiagnostic(element: PsiElement, descriptor: DeclarationDescriptor, deprecated: AnnotationDescriptor): Diagnostic {
val message = deprecated.argumentValue("value") as? String
return if (message == null)
Errors.DEPRECATED_SYMBOL.on(element, descriptor)
Errors.DEPRECATED_SYMBOL.on(element, descriptor.original)
else
Errors.DEPRECATED_SYMBOL_WITH_MESSAGE.on(element, descriptor, message)
Errors.DEPRECATED_SYMBOL_WITH_MESSAGE.on(element, descriptor.original, message)
}
private val PROPERTY_SET_OPERATIONS = TokenSet.create(JetTokens.EQ, JetTokens.PLUSEQ, JetTokens.MINUSEQ, JetTokens.MULTEQ, JetTokens.DIVEQ, JetTokens.PERCEQ, JetTokens.PLUSPLUS, JetTokens.MINUSMINUS)