a15d423db4
(required for 'suspend' on functional types).
TYPE_REFERENCE element now has MODIFIER_LIST child, which hosts annotations and modifiers for the corresponding type reference.
Annotations and modifiers written before an extension function type are now parsed as annotations and modifiers for the functional type, not the receiver type.
So, '@Ann A.(B) -> C' was '(@Ann A).(B) -> C', and became '@Ann (A.(B) -> C)'.
NB: DSL_SCOPE_VIOLATION testData updated accordingly.
Type projection variance modifiers ('in', 'out') belong to a separate modifier list under corresponding type projection (not under a type reference).
'A<in suspend T>' is 'A<(in (suspend T))>', 'A<suspend in T>' is an error.
In stub builder, create a modifier list node to host annotations and modifiers (none so far; TODO properly serialize/deserialize types with modifiers).
337 lines
9.9 KiB
Plaintext
Vendored
337 lines
9.9 KiB
Plaintext
Vendored
JetFile: FunctionsWithFunctionReceiversAnnotations.kt
|
|
PACKAGE_DIRECTIVE
|
|
<empty list>
|
|
IMPORT_LIST
|
|
<empty list>
|
|
FUN
|
|
PsiElement(fun)('fun')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
PsiElement(LPAR)('(')
|
|
MODIFIER_LIST
|
|
ANNOTATION
|
|
PsiElement(AT)('@')
|
|
PsiElement(LBRACKET)('[')
|
|
ANNOTATION_ENTRY
|
|
CONSTRUCTOR_CALLEE
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RBRACKET)(']')
|
|
PsiWhiteSpace(' ')
|
|
FUNCTION_TYPE
|
|
FUNCTION_TYPE_RECEIVER
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('T')
|
|
TYPE_ARGUMENT_LIST
|
|
PsiElement(LT)('<')
|
|
TYPE_PROJECTION
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('T')
|
|
PsiElement(GT)('>')
|
|
PsiElement(DOT)('.')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('A')
|
|
TYPE_ARGUMENT_LIST
|
|
PsiElement(LT)('<')
|
|
TYPE_PROJECTION
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('B')
|
|
PsiElement(GT)('>')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('Unit')
|
|
PsiElement(RPAR)(')')
|
|
PsiElement(DOT)('.')
|
|
PsiElement(IDENTIFIER)('foo')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace('\n')
|
|
FUN
|
|
PsiElement(fun)('fun')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
PsiElement(LPAR)('(')
|
|
MODIFIER_LIST
|
|
ANNOTATION
|
|
PsiElement(AT)('@')
|
|
PsiElement(LBRACKET)('[')
|
|
ANNOTATION_ENTRY
|
|
CONSTRUCTOR_CALLEE
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RBRACKET)(']')
|
|
PsiWhiteSpace(' ')
|
|
FUNCTION_TYPE
|
|
FUNCTION_TYPE_RECEIVER
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('T')
|
|
TYPE_ARGUMENT_LIST
|
|
PsiElement(LT)('<')
|
|
TYPE_PROJECTION
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('T')
|
|
PsiElement(GT)('>')
|
|
PsiElement(DOT)('.')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('A')
|
|
TYPE_ARGUMENT_LIST
|
|
PsiElement(LT)('<')
|
|
TYPE_PROJECTION
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('B')
|
|
PsiElement(GT)('>')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('C')
|
|
TYPE_ARGUMENT_LIST
|
|
PsiElement(LT)('<')
|
|
TYPE_PROJECTION
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('D')
|
|
PsiElement(COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_PROJECTION
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('E')
|
|
PsiElement(GT)('>')
|
|
PsiElement(RPAR)(')')
|
|
PsiElement(DOT)('.')
|
|
PsiElement(IDENTIFIER)('foo')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
PsiElement(RPAR)(')')
|
|
PsiElement(SEMICOLON)(';')
|
|
PsiWhiteSpace('\n')
|
|
FUN
|
|
PsiElement(fun)('fun')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
MODIFIER_LIST
|
|
ANNOTATION
|
|
PsiElement(AT)('@')
|
|
PsiElement(LBRACKET)('[')
|
|
ANNOTATION_ENTRY
|
|
CONSTRUCTOR_CALLEE
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RBRACKET)(']')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(LPAR)('(')
|
|
MODIFIER_LIST
|
|
ANNOTATION
|
|
PsiElement(AT)('@')
|
|
PsiElement(LBRACKET)('[')
|
|
ANNOTATION_ENTRY
|
|
CONSTRUCTOR_CALLEE
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RBRACKET)(']')
|
|
PsiWhiteSpace(' ')
|
|
FUNCTION_TYPE
|
|
FUNCTION_TYPE_RECEIVER
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('T')
|
|
TYPE_ARGUMENT_LIST
|
|
PsiElement(LT)('<')
|
|
TYPE_PROJECTION
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('T')
|
|
PsiElement(GT)('>')
|
|
PsiElement(DOT)('.')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('A')
|
|
TYPE_ARGUMENT_LIST
|
|
PsiElement(LT)('<')
|
|
TYPE_PROJECTION
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('B')
|
|
PsiElement(GT)('>')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('R')
|
|
PsiElement(RPAR)(')')
|
|
PsiElement(DOT)('.')
|
|
PsiElement(IDENTIFIER)('foo')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
BLOCK
|
|
PsiElement(LBRACE)('{')
|
|
PsiElement(RBRACE)('}')
|
|
PsiWhiteSpace('\n')
|
|
FUN
|
|
PsiElement(fun)('fun')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_PARAMETER_LIST
|
|
PsiElement(LT)('<')
|
|
TYPE_PARAMETER
|
|
PsiElement(IDENTIFIER)('A')
|
|
PsiElement(COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_PARAMETER
|
|
PsiElement(IDENTIFIER)('B')
|
|
PsiElement(GT)('>')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
MODIFIER_LIST
|
|
ANNOTATION
|
|
PsiElement(AT)('@')
|
|
PsiElement(LBRACKET)('[')
|
|
ANNOTATION_ENTRY
|
|
CONSTRUCTOR_CALLEE
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RBRACKET)(']')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(LPAR)('(')
|
|
FUNCTION_TYPE
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('Unit')
|
|
PsiElement(RPAR)(')')
|
|
PsiElement(DOT)('.')
|
|
PsiElement(IDENTIFIER)('foo')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace('\n')
|
|
FUN
|
|
MODIFIER_LIST
|
|
ANNOTATION
|
|
PsiElement(AT)('@')
|
|
PsiElement(LBRACKET)('[')
|
|
ANNOTATION_ENTRY
|
|
CONSTRUCTOR_CALLEE
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RBRACKET)(']')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(fun)('fun')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_PARAMETER_LIST
|
|
PsiElement(LT)('<')
|
|
TYPE_PARAMETER
|
|
PsiElement(IDENTIFIER)('A')
|
|
PsiElement(COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_PARAMETER
|
|
PsiElement(IDENTIFIER)('B')
|
|
PsiElement(GT)('>')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
MODIFIER_LIST
|
|
ANNOTATION
|
|
PsiElement(AT)('@')
|
|
PsiElement(LBRACKET)('[')
|
|
ANNOTATION_ENTRY
|
|
CONSTRUCTOR_CALLEE
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('a')
|
|
PsiElement(RBRACKET)(']')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(LPAR)('(')
|
|
FUNCTION_TYPE
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
VALUE_PARAMETER
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('A')
|
|
PsiElement(COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
VALUE_PARAMETER
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('B')
|
|
PsiElement(RPAR)(')')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(ARROW)('->')
|
|
PsiWhiteSpace(' ')
|
|
TYPE_REFERENCE
|
|
USER_TYPE
|
|
REFERENCE_EXPRESSION
|
|
PsiElement(IDENTIFIER)('Unit')
|
|
PsiElement(RPAR)(')')
|
|
PsiElement(DOT)('.')
|
|
PsiElement(IDENTIFIER)('foo')
|
|
VALUE_PARAMETER_LIST
|
|
PsiElement(LPAR)('(')
|
|
PsiElement(RPAR)(')')
|