diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDotQualifiedExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDotQualifiedExpression.java index a96b1e538da..e1463baab5a 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDotQualifiedExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetDotQualifiedExpression.java @@ -73,8 +73,8 @@ public class JetDotQualifiedExpression extends JetExpressionImplStub stub) { - if (stub.getParentStubOfType(JetImportDirective.class) == null) { - LOG.error("JetDotQualifiedExpression should only have stubs inside import directives.\n " + + if (stub.getParentStubOfType(JetImportDirective.class) == null && stub.getParentStubOfType(JetPackageDirective.class) == null) { + LOG.error("JetDotQualifiedExpression should only have stubs inside import or package directives.\n " + "Stubs were created for:\n " + getText() + "\nFile text:\n" + getContainingFile().getText()); return null; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetDotQualifiedExpressionElementType.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetDotQualifiedExpressionElementType.java index 20e8451694f..b12f711eb8b 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetDotQualifiedExpressionElementType.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetDotQualifiedExpressionElementType.java @@ -22,6 +22,7 @@ import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.psi.JetDotQualifiedExpression; import org.jetbrains.jet.lang.psi.JetImportDirective; +import org.jetbrains.jet.lang.psi.JetPackageDirective; public class JetDotQualifiedExpressionElementType extends JetPlaceHolderStubElementType { public JetDotQualifiedExpressionElementType(@NotNull @NonNls String debugName) { @@ -30,6 +31,6 @@ public class JetDotQualifiedExpressionElementType extends JetPlaceHolderStubElem @Override public boolean shouldCreateStub(ASTNode node) { - return PsiTreeUtil.getParentOfType(node.getPsi(), JetImportDirective.class) != null; + return PsiTreeUtil.getParentOfType(node.getPsi(), JetImportDirective.class, JetPackageDirective.class) != null; } }