if (context.isError()) {
throw new IllegalStateException("failed to analyze: " + context.getError(), context.getError());
}
final GenerationState state = new GenerationState(project, builderFactory, context, Collections.singletonList(file)) {
@Override
<BUG>protected void generateNamespace(JetFile namespace) {
PsiManager manager = PsiManager.getInstance(project);</BUG>
stubStack.push(answer);
answer.setPsiFactory(new ClsWrapperStubPsiFactory());
final ClsFileImpl fakeFile =

if (context.isError()) {
throw new IllegalStateException("failed to analyze: " + context.getError(), context.getError());
}
final GenerationState state = new GenerationState(project, builderFactory, context, Collections.singletonList(file)) {
@Override
protected void generateNamespace(FqName fqName, Collection<JetFile> namespace, CompilationErrorHandler errorHandler, Progress progress) {
PsiManager manager = PsiManager.getInstance(project);
stubStack.push(answer);
answer.setPsiFactory(new ClsWrapperStubPsiFactory());
final ClsFileImpl fakeFile =
