FE: add & fix test with intersection property shadowed by base field
This commit is contained in:
committed by
teamcity
parent
949a39b80f
commit
7904f23660
@@ -468,6 +468,20 @@ public class DescriptorUtils {
|
||||
return descriptor;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <D extends CallableMemberDescriptor> D unwrapSubstitutionOverride(@NotNull D descriptor) {
|
||||
while (descriptor.getKind() == CallableMemberDescriptor.Kind.FAKE_OVERRIDE) {
|
||||
Collection<? extends CallableMemberDescriptor> overridden = descriptor.getOverriddenDescriptors();
|
||||
if (overridden.isEmpty()) {
|
||||
throw new IllegalStateException("Fake override should have at least one overridden descriptor: " + descriptor);
|
||||
}
|
||||
if (overridden.size() > 1) return descriptor;
|
||||
descriptor = (D) overridden.iterator().next();
|
||||
}
|
||||
return descriptor;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <D extends DeclarationDescriptorWithVisibility> D unwrapFakeOverrideToAnyDeclaration(@NotNull D descriptor) {
|
||||
|
||||
Reference in New Issue
Block a user