Report incomplete hierarchy error

This is the case when you reference a Java class in Kotlin whose superclass is
not resolved. Previously this fact was swallowed by LazyJavaClassDescriptor
leading to mysterious compilation errors

 #KT-5129 Fixed
This commit is contained in:
Alexander Udalov
2015-02-09 17:28:02 +03:00
parent 28d8c8906a
commit 4128655893
12 changed files with 111 additions and 23 deletions
@@ -20,12 +20,17 @@ import org.jetbrains.kotlin.load.java.components.ErrorReporter
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.load.kotlin.KotlinJvmBinaryClass
import com.intellij.openapi.diagnostic.Logger
import org.jetbrains.kotlin.descriptors.ClassDescriptor
class LoggingErrorReporter(private val log: Logger) : ErrorReporter {
override fun reportLoadingError(message: String, exception: Exception?) {
log.error(message, exception)
}
override fun reportIncompleteHierarchy(descriptor: ClassDescriptor, unresolvedSuperClasses: List<String>) {
log.error("Incomplete hierarchy for $descriptor. Super classes are not found: $unresolvedSuperClasses")
}
override fun reportCannotInferVisibility(descriptor: CallableMemberDescriptor) {
log.error("Could not infer visibility for $descriptor")
}