diff --git a/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.txt b/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.txt new file mode 100644 index 00000000000..f8dcc68f39c --- /dev/null +++ b/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.txt @@ -0,0 +1,810 @@ +JetFile: FunctionTypesWithFunctionReceivers.jet + NAMESPACE_HEADER + + TYPEDEF + PsiElement(type)('type') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(GT)('>') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(GT)('>') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + TYPEDEF + PsiElement(type)('type') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('S') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + TYPEDEF + PsiElement(type)('type') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + TYPEDEF + PsiElement(type)('type') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + TYPEDEF + PsiElement(type)('type') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(GT)('>') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(GT)('>') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + TYPEDEF + PsiElement(type)('type') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('S') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + TYPEDEF + PsiElement(type)('type') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiErrorElement:Type expected + + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + MODIFIER_LIST + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('S') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + TYPEDEF + PsiElement(type)('type') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiErrorElement:Type expected + + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + MODIFIER_LIST + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + TYPEDEF + PsiElement(type)('type') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiErrorElement:Type expected + + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + MODIFIER_LIST + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + TYPEDEF + PsiElement(type)('type') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiErrorElement:Type expected + + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + MODIFIER_LIST + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(GT)('>') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(GT)('>') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + TYPEDEF + PsiElement(type)('type') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiErrorElement:Type expected + + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + MODIFIER_LIST + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('S') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceivers.txt b/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceivers.txt new file mode 100644 index 00000000000..ef905a2f7aa --- /dev/null +++ b/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceivers.txt @@ -0,0 +1,530 @@ +JetFile: FunctionsWithFunctionReceivers.jet + NAMESPACE_HEADER + + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Expecting '.' before a function name + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting function name + PsiElement(LBRACKET)('[') + PsiErrorElement:Expecting '(' + + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + 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)('>') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + 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)('>') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + FUN + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n') + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Expecting '.' before a function name + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting function name + PsiElement(LBRACKET)('[') + PsiErrorElement:Expecting '(' + + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + 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)('>') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + 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)('>') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(SEMICOLON)(';') + PsiWhiteSpace('\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Expecting '.' before a function name + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting function name + PsiElement(LBRACKET)('[') + PsiErrorElement:Expecting '(' + + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + 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)('>') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + 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)('>') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + TYPE_REFERENCE + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiErrorElement:Type expected + + PsiWhiteSpace(' ') + PsiErrorElement:Expecting '.' before a function name + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting function name + PsiElement(LBRACKET)('[') + PsiErrorElement:Expecting '(' + + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + 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)('>') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + 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)('>') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + 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 + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiErrorElement:Type expected + + PsiWhiteSpace(' ') + PsiErrorElement:Expecting '.' before a function name + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting function name + + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Unit') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + FUN + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n\n') + PsiComment(EOL_COMMENT)('// And tuples, too') + PsiWhiteSpace('\n') + PsiElement(fun)('fun') + PsiErrorElement:Expecting function name or receiver type + + PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('A') + PsiErrorElement:Parameters must have type annotation + + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('B') + PsiErrorElement:Parameters must have type annotation + + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Unit') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n\n') + PsiComment(EOL_COMMENT)('// Recovery') + PsiWhiteSpace('\n') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Expecting '.' before a function name + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting function name + PsiElement(LBRACKET)('[') + PsiErrorElement:Expecting '(' + + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + 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)('>') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + 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)('>') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(DOT)('.') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(MINUS)('-') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LPAR)('(') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') \ No newline at end of file diff --git a/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceivers.txt b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceivers.txt new file mode 100644 index 00000000000..5189feb1f32 --- /dev/null +++ b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceivers.txt @@ -0,0 +1,526 @@ +JetFile: PropertiesWithFunctionReceivers.jet + NAMESPACE_HEADER + + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Property getter or setter expected + PsiElement(LBRACE)('{') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Property getter or setter expected + PsiElement(LBRACE)('{') + PsiElement(IDENTIFIER)('foo') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('bar') + PsiElement(DOT)('.') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Property getter or setter expected + PsiElement(LBRACE)('{') + PsiElement(IDENTIFIER)('foo') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('bar') + PsiElement(DOT)('.') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('get') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('set') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('it') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Property getter or setter expected + PsiElement(LBRACE)('{') + PsiElement(IDENTIFIER)('foo') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('bar') + PsiElement(DOT)('.') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('get') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Foo') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('set') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('it') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Property getter or setter expected + PsiElement(LBRACE)('{') + PsiElement(IDENTIFIER)('foo') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('bar') + PsiElement(DOT)('.') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('bar') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MODIFIER_LIST + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + PsiElement(public)('public') + PsiWhiteSpace(' ') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('get') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + MODIFIER_LIST + PsiElement(open)('open') + PsiWhiteSpace(' ') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('set') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + BINARY_WITH_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('b') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Property getter or setter expected + PsiElement(LBRACE)('{') + PsiElement(IDENTIFIER)('foo') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('bar') + PsiElement(DOT)('.') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('bar') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MODIFIER_LIST + PsiElement(open)('open') + PsiWhiteSpace(' ') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('set') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + BINARY_WITH_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('b') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Property getter or setter expected + PsiElement(LBRACE)('{') + PsiElement(IDENTIFIER)('foo') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('bar') + PsiElement(DOT)('.') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('bar') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MODIFIER_LIST + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + PsiElement(public)('public') + PsiWhiteSpace(' ') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('get') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + PsiComment(EOL_COMMENT)('// Error recovery:') + PsiWhiteSpace('\n\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Property getter or setter expected + PsiElement(LBRACE)('{') + PsiElement(IDENTIFIER)('foo') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('bar') + PsiElement(DOT)('.') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('set') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('dfget') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiErrorElement:Property getter or setter expected + PsiElement(LBRACE)('{') + PsiElement(IDENTIFIER)('foo') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('bar') + PsiElement(DOT)('.') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiElement(DOT)('.') + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace('\n ') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('get') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('set') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('set') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(LBRACE)('{') + PsiErrorElement:Expecting package directive or top level declaration + PsiElement(RBRACE)('}') \ No newline at end of file