From 2a9362930512b8749d452d03841ab62c9a41bc60 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 26 Aug 2015 16:41:16 +0300 Subject: [PATCH] Render original descriptor in the deprecation warning Otherwise it gets confusing when multiple instantiations of the same deprecated symbol (e.g. javaClass()) are diagnosed with different type arguments --- .../kotlin/resolve/validation/DeprecatedSymbolValidator.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/validation/DeprecatedSymbolValidator.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/validation/DeprecatedSymbolValidator.kt index b9f7a41ec3a..d01f4347fdc 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/validation/DeprecatedSymbolValidator.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/validation/DeprecatedSymbolValidator.kt @@ -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)