Assertion messages added

This commit is contained in:
Nikolay Krasko
2014-01-21 15:35:01 +04:00
parent eb2f3eee4d
commit 1832973491
2 changed files with 6 additions and 3 deletions
@@ -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.
@@ -390,7 +390,9 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
for (JetDelegationSpecifier specifier : delegationSpecifiers) {
if (specifier instanceof JetDelegatorToSuperClass || specifier instanceof JetDelegatorToSuperCall) {
JetType superType = bindingContext.get(BindingContext.TYPE, specifier.getTypeReference());
assert superType != null;
assert superType != null :
String.format("No type recorded for \n---\n%s\n---\n", JetPsiUtil.getElementTextWithContext(specifier));
ClassDescriptor superClassDescriptor = (ClassDescriptor) superType.getConstructor().getDeclarationDescriptor();
assert superClassDescriptor != null;
if (!isInterface(superClassDescriptor)) {
@@ -154,7 +154,8 @@ class CodegenAnnotatingVisitor extends JetVisitorVoid {
@Override
public void visitEnumEntry(@NotNull JetEnumEntry enumEntry) {
ClassDescriptor descriptor = bindingContext.get(CLASS, enumEntry);
assert descriptor != null;
assert descriptor != null :
String.format("No descriptor for enum entry \n---\n%s\n---\n", JetPsiUtil.getElementTextWithContext(enumEntry));
boolean trivial = enumEntry.getDeclarations().isEmpty();
if (!trivial) {