[FE] Don't throw assertion in OverrideResolver if directOverridden is empty

Those descriptors may be empty in case user made a mistake and tried to
  delegate implementation of abstract class instead of interface (and
  we don't add functions from abstract class to overriden descriptors
  of fake overrides in case of delegation by)

#KT-40510 Fixed
This commit is contained in:
Dmitriy Novozhilov
2020-12-17 12:21:34 +03:00
parent dea01125d6
commit 6296f6dc33
6 changed files with 65 additions and 1 deletions
@@ -586,7 +586,9 @@ class OverrideResolver(
if (kind != FAKE_OVERRIDE && kind != DELEGATION) return
val directOverridden = descriptor.overriddenDescriptors
assert(!directOverridden.isEmpty()) { kind.toString() + " " + descriptor.name.asString() + " must override something" }
// directOverridden may be empty if user tries to delegate implementation of abstract class instead of interface
if (directOverridden.isEmpty()) return
// collects map from the directly overridden descriptor to the set of declarations:
// -- if directly overridden is not fake, the set consists of one element: this directly overridden