diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor.java b/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor.java index 53a7d62e4b2..2ee34229d51 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor.java @@ -95,25 +95,28 @@ public class TypeParameterDescriptor extends DeclarationDescriptorImpl implement upperBounds); } - public void setInitialized() { - if (initialized) { - throw new IllegalStateException(); - } - initialized = true; - } - private void checkInitialized() { if (!initialized) { - throw new IllegalStateException(); + throw new IllegalStateException("Type parameter descriptor in not initialized: " + nameForAssertions()); } } private void checkUninitialized() { if (initialized) { - throw new IllegalStateException(); + throw new IllegalStateException("Type parameter descriptor is already initialized: " + nameForAssertions()); } } + private String nameForAssertions() { + DeclarationDescriptor owner = getContainingDeclaration(); + return getName() + " declared in " + (owner == null ? "" : owner.getName()); + } + + public void setInitialized() { + checkUninitialized(); + initialized = true; + } + public boolean isReified() { checkInitialized(); return reified;