Consider callable reference's LHS when resolving RHS

Previous resolution sequence (static scope, nested classes scope, receiver) and
a check against type parameters only made sense when there's a type, not an
expression, on the LHS of a callable reference. Also TransientReceiver is
incorrect in such case because private-to-this visibility check only works for
ExpressionReceiver values
This commit is contained in:
Alexander Udalov
2016-06-15 19:24:46 +03:00
parent 6562a2db19
commit 456ba79793
11 changed files with 180 additions and 25 deletions
@@ -1751,11 +1751,35 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("innerNested.kt")
public void testInnerNested() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/callableReference/bound/innerNested.kt");
doTest(fileName);
}
@TestMetadata("object.kt")
public void testObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/callableReference/bound/object.kt");
doTest(fileName);
}
@TestMetadata("privateToThis.kt")
public void testPrivateToThis() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/callableReference/bound/privateToThis.kt");
doTest(fileName);
}
@TestMetadata("referenceToStaticMethodOnInstance.kt")
public void testReferenceToStaticMethodOnInstance() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/callableReference/bound/referenceToStaticMethodOnInstance.kt");
doTest(fileName);
}
@TestMetadata("valueOfTypeParameterType.kt")
public void testValueOfTypeParameterType() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/callableReference/bound/valueOfTypeParameterType.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/diagnostics/tests/callableReference/function")