diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenAnnotatingVisitor.java b/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenAnnotatingVisitor.java index 85aaaf21f17..c61de402204 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenAnnotatingVisitor.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenAnnotatingVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2013 JetBrains s.r.o. + * Copyright 2010-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -171,7 +171,9 @@ class CodegenAnnotatingVisitor extends JetVisitorVoid { @Override public void visitClassObject(@NotNull JetClassObject classObject) { ClassDescriptor classDescriptor = bindingContext.get(CLASS, classObject.getObjectDeclaration()); - assert classDescriptor != null; + + assert classDescriptor != null : String.format("No class found in binding context for: \n---\n%s\n---\n", + JetPsiUtil.getElementTextWithContext(classObject)); String name = peekFromStack(nameStack) + JvmAbi.CLASS_OBJECT_SUFFIX; recordClosure(classObject, classDescriptor, name); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenBinding.java b/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenBinding.java index 60ef4d09c8d..2bfcfe11545 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenBinding.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenBinding.java @@ -337,8 +337,12 @@ public class CodegenBinding { } for (JetDelegationSpecifier specifier : ((JetClassOrObject) classOrObject).getDelegationSpecifiers()) { if (specifier instanceof JetDelegatorToSuperCall) { - JetType superType = bindingContext.get(TYPE, specifier.getTypeReference()); - assert superType != null; + JetTypeReference typeReference = specifier.getTypeReference(); + + JetType superType = bindingContext.get(TYPE, typeReference); + assert superType != null: String.format( + "No type in binding context for \n---\n%s\n---\n", JetPsiUtil.getElementTextWithContext(specifier)); + ClassDescriptor superClassDescriptor = (ClassDescriptor) superType.getConstructor().getDeclarationDescriptor(); assert superClassDescriptor != null; if (!isInterface(superClassDescriptor)) {