Fix substitutor for synthetic SAM adapters

When synthetic member comes not from the receiver type itself,
but from one of its supertypes it doesn't make sense to subsitute
the member with receiver type, we should obtain relevant supertype
and use it instead.

 #KT-16578 Fixed
This commit is contained in:
Denis Zharkov
2017-03-01 20:02:51 +03:00
parent 9e5ecc11b7
commit 415c3d57af
5 changed files with 60 additions and 8 deletions
@@ -12234,6 +12234,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("samOnTypeParameter.kt")
public void testSamOnTypeParameter() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/sam/samOnTypeParameter.kt");
doTest(fileName);
}
@TestMetadata("typeInferenceOnSamAdapters.kt")
public void testTypeInferenceOnSamAdapters() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/sam/typeInferenceOnSamAdapters.kt");