KT-6920 Reference this marked as deprecated if extension function is deprecated

#KT-6920 fixed
This commit is contained in:
Evgeny Gerashchenko
2015-03-05 21:47:30 +03:00
parent 06e3b5937f
commit c6352ec699
3 changed files with 16 additions and 0 deletions
@@ -63,6 +63,11 @@ public class DeprecatedAnnotationVisitor extends AfterAnalysisHighlightingVisito
@Override
public void visitReferenceExpression(@NotNull JetReferenceExpression expression) {
super.visitReferenceExpression(expression);
if (expression.getParent() instanceof JetThisExpression) {
return;
}
ResolvedCall resolvedCall = CallUtilPackage.getResolvedCall(expression, bindingContext);
if (resolvedCall != null && resolvedCall instanceof VariableAsFunctionResolvedCall) {
// Deprecated for invoke()
@@ -0,0 +1,5 @@
deprecated("does nothing good")
fun Any.doNothing() = this.toString() // "this" should not be marked as deprecated despite it referes to deprecated function
// NO_CHECK_INFOS
// NO_CHECK_WEAK_WARNINGS
@@ -113,6 +113,12 @@ public class HighlightingTestGenerated extends AbstractHighlightingTest {
doTest(fileName);
}
@TestMetadata("ExtensionFunction.kt")
public void testExtensionFunction() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/highlighter/deprecated/ExtensionFunction.kt");
doTest(fileName);
}
@TestMetadata("Function.kt")
public void testFunction() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/highlighter/deprecated/Function.kt");