Added tests on resolved calls

for annotation entry, delegator to super call, array access
This commit is contained in:
Svetlana Isakova
2014-07-10 17:53:13 +04:00
parent 22624186f6
commit eca2c7beea
8 changed files with 81 additions and 1 deletions
@@ -49,6 +49,8 @@ import org.jetbrains.kotlin.util.sure
import org.jetbrains.jet.lang.psi.JetCallElement
import org.jetbrains.jet.lang.psi.psiUtil.getTextWithLocation
import org.jetbrains.jet.lang.psi.JetInstanceExpressionWithLabel
import org.jetbrains.jet.lang.psi.JetConstructorCalleeExpression
import org.jetbrains.jet.lang.psi.JetUserType
/**
* For expressions like <code>a(), a[i], a.b.c(), +a, a + b, (a()), a(): Int, @label a()</code>
@@ -64,6 +66,7 @@ public fun JetElement.getCall(context: BindingContext): Call? {
val parent = element.getParent()
val reference = when {
parent is JetInstanceExpressionWithLabel -> parent : JetInstanceExpressionWithLabel
parent is JetUserType -> parent.getParent()?.getParent() as? JetConstructorCalleeExpression
else -> element.getCalleeExpressionIfAny()
}
if (reference != null) {