diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationResolver.java index 2c04a5c459e..69410941a23 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationResolver.java @@ -277,6 +277,11 @@ public class DeclarationResolver { if (declarationDescriptor instanceof NamespaceDescriptor) { final NamespaceDescriptor namespace = (NamespaceDescriptor)declarationDescriptor; Collection files = trace.get(BindingContext.NAMESPACE_TO_FILES, namespace); + + if (files == null) { + throw new IllegalStateException("declarations corresponding to " + namespace + " are not found"); + } + declarations = Collections2.transform(files, new Function() { @Override public PsiElement apply(@Nullable JetFile file) {