From e55b4491aea2ef1da61ed8cdc23c3f7b3a9d26b3 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Fri, 28 Oct 2011 18:07:18 +0400 Subject: [PATCH] Test for KT-26 Import namespaces defined in this file --- .../checkerWithErrorTypes/quick/regressions/kt26-1.jet | 7 +++++++ .../checkerWithErrorTypes/quick/regressions/kt26.jet | 10 ++++++++++ compiler/testData/psi/Imports_ERR.txt | 10 +++++++--- 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 compiler/testData/checkerWithErrorTypes/quick/regressions/kt26-1.jet create mode 100644 compiler/testData/checkerWithErrorTypes/quick/regressions/kt26.jet diff --git a/compiler/testData/checkerWithErrorTypes/quick/regressions/kt26-1.jet b/compiler/testData/checkerWithErrorTypes/quick/regressions/kt26-1.jet new file mode 100644 index 00000000000..ff27f3515f3 --- /dev/null +++ b/compiler/testData/checkerWithErrorTypes/quick/regressions/kt26-1.jet @@ -0,0 +1,7 @@ +// KT-26 Import namespaces defined in this file + +namespace foo { + import bar.* // Must not be an error +} + +namespace bar {} \ No newline at end of file diff --git a/compiler/testData/checkerWithErrorTypes/quick/regressions/kt26.jet b/compiler/testData/checkerWithErrorTypes/quick/regressions/kt26.jet new file mode 100644 index 00000000000..f79b7a901f8 --- /dev/null +++ b/compiler/testData/checkerWithErrorTypes/quick/regressions/kt26.jet @@ -0,0 +1,10 @@ +// KT-26 Import namespaces defined in this file + +import html.* // Must not be an error + +namespace html { + + abstract class Factory { + fun create() : T? = null + } +} \ No newline at end of file diff --git a/compiler/testData/psi/Imports_ERR.txt b/compiler/testData/psi/Imports_ERR.txt index f9832e87923..5ad833b88df 100644 --- a/compiler/testData/psi/Imports_ERR.txt +++ b/compiler/testData/psi/Imports_ERR.txt @@ -18,7 +18,8 @@ JetFile: Imports_ERR.jet PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiErrorElement:Expecting qualified name - PsiElement(SEMICOLON)(';') + + PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n') IMPORT_DIRECTIVE PsiElement(import)('import') @@ -27,7 +28,9 @@ JetFile: Imports_ERR.jet PsiElement(DOT)('.') REFERENCE_EXPRESSION PsiErrorElement:Expecting qualified name - PsiElement(MUL)('*') + + PsiErrorElement:Expecting namespace or top level declaration + PsiElement(MUL)('*') PsiWhiteSpace('\n') IMPORT_DIRECTIVE PsiElement(import)('import') @@ -37,7 +40,8 @@ JetFile: Imports_ERR.jet PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiErrorElement:Expecting qualified name - PsiElement(SEMICOLON)(';') + + PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n\n') IMPORT_DIRECTIVE PsiElement(import)('import')