Light classes: handle broken context in case of supertype delegation

This lead to an exception being thrown frequently
Proper fix would be to prevent binding context from being corrupted
Known cases are hard to debug/reproduce

 #EA-101081 Fixed
This commit is contained in:
Pavel V. Talanov
2018-07-10 17:39:07 +02:00
parent 991b4251f3
commit 770c280ba5
@@ -98,9 +98,8 @@ object CodegenUtil {
@JvmStatic
fun getSuperClassBySuperTypeListEntry(specifier: KtSuperTypeListEntry, bindingContext: BindingContext): ClassDescriptor? {
val superType = bindingContext.get(BindingContext.TYPE, specifier.typeReference!!)
?: error("superType should not be null: ${specifier.text}")
return superType.constructor.declarationDescriptor as? ClassDescriptor
return superType?.constructor?.declarationDescriptor as? ClassDescriptor
}
@JvmStatic