Files
kotlin-fork/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversRecovery.txt
T
Dmitry Petrov a15d423db4 Support modifiers on types in parser
(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).
2016-12-15 23:57:41 +03:00

459 lines
14 KiB
Plaintext
Vendored

JetFile: PropertiesWithFunctionReceiversRecovery.kt
PACKAGE_DIRECTIVE
<empty list>
IMPORT_LIST
<empty list>
PROPERTY
PsiElement(val)('val')
PsiWhiteSpace(' ')
TYPE_REFERENCE
PsiElement(LPAR)('(')
FUNCTION_TYPE
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
VALUE_PARAMETER
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('G')
PsiElement(RPAR)(')')
PsiElement(DOT)('.')
PsiElement(IDENTIFIER)('foo')
PsiErrorElement:Property getter or setter expected
PsiElement(LT)('<')
PsiElement(IDENTIFIER)('P')
PsiElement(GT)('>')
PsiWhiteSpace(' ')
FUN
PsiErrorElement:Expecting a top level declaration
<empty list>
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace(' ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n')
PROPERTY
PsiElement(val)('val')
PsiWhiteSpace(' ')
TYPE_REFERENCE
PsiElement(LPAR)('(')
FUNCTION_TYPE
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
VALUE_PARAMETER
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('G')
PsiElement(RPAR)(')')
PsiElement(DOT)('.')
PsiElement(IDENTIFIER)('foo')
PsiWhiteSpace(' ')
PROPERTY_ACCESSOR
PsiElement(get)('get')
PsiErrorElement:Accessor body expected
<empty list>
PsiErrorElement:Expecting '('
<empty list>
PsiErrorElement:Expecting ')'
<empty list>
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace(' ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n')
PROPERTY
PsiElement(val)('val')
PsiWhiteSpace(' ')
TYPE_REFERENCE
PsiElement(LPAR)('(')
FUNCTION_TYPE
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
VALUE_PARAMETER
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('G')
PsiElement(RPAR)(')')
PsiElement(DOT)('.')
PsiElement(IDENTIFIER)('foo')
PsiErrorElement:Property getter or setter expected
PsiElement(LT)('<')
PsiElement(IDENTIFIER)('P')
PsiElement(GT)('>')
PsiWhiteSpace('\n')
PROPERTY
PsiElement(val)('val')
PsiWhiteSpace(' ')
TYPE_REFERENCE
PsiElement(LPAR)('(')
FUNCTION_TYPE
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
VALUE_PARAMETER
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('G')
PsiElement(RPAR)(')')
PsiElement(DOT)('.')
PsiElement(IDENTIFIER)('foo')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
PsiErrorElement:Type expected
<empty list>
PsiElement(EQ)('=')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('0')
PsiWhiteSpace('\n')
PROPERTY
PsiElement(val)('val')
PsiWhiteSpace(' ')
TYPE_REFERENCE
NULLABLE_TYPE
PsiElement(LPAR)('(')
FUNCTION_TYPE
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
VALUE_PARAMETER
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('G')
PsiElement(RPAR)(')')
PsiElement(QUEST)('?')
PsiElement(DOT)('.')
PsiElement(IDENTIFIER)('foo')
PsiWhiteSpace('\n')
PROPERTY
PsiElement(val)('val')
PsiWhiteSpace(' ')
TYPE_REFERENCE
NULLABLE_TYPE
NULLABLE_TYPE
PsiElement(LPAR)('(')
FUNCTION_TYPE
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
VALUE_PARAMETER
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('G')
PsiElement(RPAR)(')')
PsiElement(QUEST)('?')
PsiElement(QUEST)('?')
PsiElement(DOT)('.')
PsiElement(IDENTIFIER)('foo')
PsiWhiteSpace('\n\n')
PROPERTY
PsiElement(val)('val')
PsiWhiteSpace(' ')
TYPE_REFERENCE
PsiElement(LPAR)('(')
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(COMMA)(',')
PsiWhiteSpace(' ')
VALUE_PARAMETER
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)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
TYPE_REFERENCE
PsiErrorElement:Type expected
<empty list>
PsiElement(RPAR)(')')
PsiElement(DOT)('.')
PsiElement(IDENTIFIER)('foo')
PsiErrorElement:Property getter or setter expected
<empty list>
PsiWhiteSpace(' ')
FUN
PsiErrorElement:Expecting a top level declaration
<empty list>
BLOCK
PsiElement(LBRACE)('{')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n')
PROPERTY
PsiElement(val)('val')
PsiErrorElement:Expecting property name or receiver type
<empty list>
PsiErrorElement:Property getter or setter expected
<empty list>
PsiWhiteSpace(' ')
DESTRUCTURING_DECLARATION
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiErrorElement:Receiver type is not allowed on a destructuring declaration
TYPE_REFERENCE
MODIFIER_LIST
ANNOTATION_ENTRY
PsiElement(AT)('@')
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
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)('.')
PsiErrorElement:Destructuring declarations are only allowed for local variables/values
PsiElement(LPAR)('(')
DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('A')
PsiErrorElement:Expecting ')'
PsiElement(LT)('<')
PsiErrorElement:Property getter or setter expected
PsiElement(IDENTIFIER)('B')
PsiElement(GT)('>')
PsiElement(RPAR)(')')
PsiElement(DOT)('.')
PsiElement(IDENTIFIER)('foo')
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace('\n\n')
PROPERTY
PsiElement(val)('val')
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(' ')
FUNCTION_TYPE
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
VALUE_PARAMETER
TYPE_REFERENCE
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)(')')
PsiErrorElement:Expecting '->' to specify return type of a function type
PsiElement(RPAR)(')')
TYPE_REFERENCE
PsiErrorElement:Type expected
PsiElement(DOT)('.')
PsiErrorElement:Expecting comma or ')'
<empty list>
PsiErrorElement:Expecting ')'
PsiElement(IDENTIFIER)('foo')
PsiErrorElement:Expecting '->' to specify return type of a function type
PsiElement(LPAR)('(')
TYPE_REFERENCE
PsiErrorElement:Type expected
PsiElement(RPAR)(')')
PsiErrorElement:Expecting '.' before a property name
<empty list>
PsiWhiteSpace('\n')
DESTRUCTURING_DECLARATION
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiErrorElement:Receiver type is not allowed on a destructuring declaration
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(' ')
FUNCTION_TYPE
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
VALUE_PARAMETER
TYPE_REFERENCE
PsiElement(LPAR)('(')
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)(')')
PsiErrorElement:Expecting comma or ')'
<empty list>
PsiErrorElement:Expecting ')'
PsiElement(MINUS)('-')
PsiErrorElement:Expecting '->' to specify return type of a function type
PsiElement(RPAR)(')')
TYPE_REFERENCE
PsiErrorElement:Type expected
PsiElement(DOT)('.')
PsiErrorElement:Expecting '.' before a property name
PsiElement(IDENTIFIER)('foo')
PsiErrorElement:Destructuring declarations are only allowed for local variables/values
PsiElement(LPAR)('(')
PsiErrorElement:Expecting a name
<empty list>
PsiElement(RPAR)(')')
PsiWhiteSpace('\n\n')
PROPERTY
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('c')
PsiErrorElement:Property getter or setter expected
PsiElement(LT)('<')
PsiElement(IDENTIFIER)('T')
PsiElement(GT)('>')
PsiWhiteSpace(' ')
PsiElement(by)('by')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('A')
PsiElement(DOT)('.')
PsiElement(IDENTIFIER)('B')