Don't add delegated members from error types

This commit is contained in:
Andrey Breslav
2014-03-19 19:27:46 +04:00
parent 34c6eaec56
commit bf2cc99109
3 changed files with 9 additions and 1 deletions
@@ -129,7 +129,7 @@ public final class DelegationResolver<T extends CallableMemberDescriptor> {
continue;
}
JetType delegatedTraitType = typeResolver.resolve(typeReference);
if (delegatedTraitType == null) {
if (delegatedTraitType == null || delegatedTraitType.isError()) {
continue;
}
Collection<T> delegatesForTrait = generateDelegatesForTrait(delegatedMembers, delegatedTraitType);
@@ -0,0 +1,3 @@
class C : <!UNRESOLVED_REFERENCE, DELEGATION_NOT_TO_TRAIT!>Base1<!> by <!UNRESOLVED_REFERENCE!>Base2<!>(1) {
fun test() { }
}
@@ -5331,6 +5331,11 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest("compiler/testData/diagnostics/tests/override/kt880.kt");
}
@TestMetadata("MissingDelegate.kt")
public void testMissingDelegate() throws Exception {
doTest("compiler/testData/diagnostics/tests/override/MissingDelegate.kt");
}
@TestMetadata("MultipleDefaultParametersInSupertypes.kt")
public void testMultipleDefaultParametersInSupertypes() throws Exception {
doTest("compiler/testData/diagnostics/tests/override/MultipleDefaultParametersInSupertypes.kt");