diff --git a/compiler/testData/psi/annotation/annotationsOnNullableTypes.kt b/compiler/testData/psi/annotation/annotationsOnNullableTypes.kt new file mode 100644 index 00000000000..20485a7abb5 --- /dev/null +++ b/compiler/testData/psi/annotation/annotationsOnNullableTypes.kt @@ -0,0 +1,3 @@ +fun foo(i: @a Int?) {} + +fun @a Int?.bar() {} \ No newline at end of file diff --git a/compiler/testData/psi/annotation/annotationsOnNullableTypes.txt b/compiler/testData/psi/annotation/annotationsOnNullableTypes.txt new file mode 100644 index 00000000000..bebc4035d7f --- /dev/null +++ b/compiler/testData/psi/annotation/annotationsOnNullableTypes.txt @@ -0,0 +1,61 @@ +JetFile: annotationsOnNullableTypes.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('i') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + NULLABLE_TYPE + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(QUEST)('?') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + TYPE_REFERENCE + NULLABLE_TYPE + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(QUEST)('?') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('bar') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java index 53381e5f441..45445d58c26 100644 --- a/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java @@ -771,6 +771,12 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest { doParsingTest(fileName); } + @TestMetadata("annotationsOnNullableTypes.kt") + public void testAnnotationsOnNullableTypes() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/annotation/annotationsOnNullableTypes.kt"); + doParsingTest(fileName); + } + @TestMetadata("AnnotationsOnPatterns.kt") public void testAnnotationsOnPatterns() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/annotation/AnnotationsOnPatterns.kt");