Improve diagnostics on callable reference of unresolved class

#KT-10839 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-06-22 02:50:07 +03:00
parent 0579604653
commit 87a41293e8
12 changed files with 41 additions and 25 deletions
@@ -528,7 +528,9 @@ class DoubleColonExpressionResolver(
resolvedCall?.resultingDescriptor ?: return null
}
else {
context.trace.report(UNRESOLVED_REFERENCE.on(expression.callableReference, expression.callableReference))
if (lhs != null || expression.isEmptyLHS) {
context.trace.report(UNRESOLVED_REFERENCE.on(expression.callableReference, expression.callableReference))
}
return null
}
@@ -680,10 +682,13 @@ class DoubleColonExpressionResolver(
): OverloadResolutionResults<CallableDescriptor>? {
val reference = expression.callableReference
val lhsType =
lhs?.type ?:
return tryResolveRHSWithReceiver("resolve callable reference with empty LHS", null, reference, c, mode)
val lhsType = lhs?.type
if (lhsType == null) {
if (!expression.isEmptyLHS) return null
return tryResolveRHSWithReceiver("resolve callable reference with empty LHS", null, reference, c, mode)
?.apply { commitTrace() }?.results
}
val resultSequence = buildSequence {
when (lhs) {