From 5f697896363e36b6fff9369ea17439690df339d9 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Wed, 23 Sep 2015 12:48:30 +0300 Subject: [PATCH] Stop parsing lambdas with deprecated syntax --- .../kotlin/parsing/JetExpressionParsing.java | 129 --- compiler/testData/psi/CallsInWhen.kt | 2 +- compiler/testData/psi/CallsInWhen.txt | 5 +- compiler/testData/psi/FunctionLiterals.txt | 796 +++++++++--------- .../testData/psi/FunctionLiterals_ERR.txt | 436 +++++----- .../psi/examples/FunctionsAndTypes.kt | 4 +- .../psi/examples/FunctionsAndTypes.txt | 83 -- compiler/testData/psi/examples/LINQ.kt | 2 +- compiler/testData/psi/examples/LINQ.txt | 2 - .../testData/psi/examples/util/Comparison.kt | 2 +- .../testData/psi/examples/util/Comparison.txt | 2 - .../greatSyntacticShift/functionLiterals.kt | 27 +- .../greatSyntacticShift/functionLiterals.txt | 764 ----------------- grammar/src/expressions.grm | 1 - .../caches/resolve/ModuleDependencyMapper.kt | 2 +- 15 files changed, 628 insertions(+), 1629 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetExpressionParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetExpressionParsing.java index cc51bc7ca41..33edb3472ba 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetExpressionParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetExpressionParsing.java @@ -1044,7 +1044,6 @@ public class JetExpressionParsing extends AbstractJetParsing { * functionLiteral // one can use "it" as a parameter name * : "{" expressions "}" * : "{" (modifiers SimpleName){","} "->" statements "}" - * : "{" (type ".")? "(" (modifiers SimpleName (":" type)?){","} ")" (":" type)? "->" expressions "}" * ; */ private void parseFunctionLiteral() { @@ -1069,25 +1068,6 @@ public class JetExpressionParsing extends AbstractJetParsing { advance(); // ARROW paramsFound = true; } - else if (at(LPAR)) { - // Look for ARROW after matching RPAR - // {(a, b) -> ...} - - { - PsiBuilder.Marker rollbackMarker = mark(); - boolean preferParamsToExpressions = parseFunctionLiteralParametersAndType(); - - paramsFound = preferParamsToExpressions ? - rollbackOrDrop(rollbackMarker, ARROW, "An -> is expected", RBRACE) : - rollbackOrDropAt(rollbackMarker, ARROW); - } - - if (!paramsFound) { - // If not found, try a typeRef DOT and then LPAR .. RPAR ARROW - // {((A) -> B).(x) -> ... } - paramsFound = parseFunctionTypeDotParametersAndType(); - } - } else { if (at(IDENTIFIER) || at(COLON)) { // Try to parse a simple name list followed by an ARROW @@ -1101,11 +1081,6 @@ public class JetExpressionParsing extends AbstractJetParsing { rollbackOrDrop(rollbackMarker, ARROW, "An -> is expected", RBRACE) : rollbackOrDropAt(rollbackMarker, ARROW); } - if (!paramsFound && atSet(JetParsing.TYPE_REF_FIRST)) { - // Try to parse a type DOT valueParameterList ARROW - // {A.(b) -> ...} - paramsFound = parseFunctionTypeDotParametersAndType(); - } } if (!paramsFound) { @@ -1200,110 +1175,6 @@ public class JetExpressionParsing extends AbstractJetParsing { parameterList.done(VALUE_PARAMETER_LIST); } - private boolean parseFunctionTypeDotParametersAndType() { - PsiBuilder.Marker rollbackMarker = mark(); - - // True when it's confirmed that body of literal can't be simple expressions and we prefer to parse - // it to function params if possible. - boolean preferParamsToExpressions = false; - - // Last dot before ARROW and RPAR, but also stop at top-level keywords and '{', '}' - int lastDot = matchTokenStreamPredicate(new LastBefore( - new At(DOT), - new AtSet(TokenSet.orSet( - TokenSet.create(ARROW, RPAR), - TokenSet.orSet( - TokenSet.create(LBRACE, RBRACE), - TokenSet.andNot( - KEYWORDS, - TokenSet.create(CAPITALIZED_THIS_KEYWORD) - ) - ) - )) - )); - - if (lastDot >= 0) { - createTruncatedBuilder(lastDot).parseTypeRef(); - if (at(DOT)) { - advance(); // DOT - preferParamsToExpressions = parseFunctionLiteralParametersAndType(); - } - } - - return preferParamsToExpressions ? - rollbackOrDrop(rollbackMarker, ARROW, "An -> is expected", RBRACE) : - rollbackOrDropAt(rollbackMarker, ARROW); - } - - private boolean parseFunctionLiteralParametersAndType() { - boolean hasCommaInParametersList = parseFunctionLiteralParameterList(); - parseOptionalFunctionLiteralType(); - return hasCommaInParametersList; - } - - /* - * (":" type)? - */ - private void parseOptionalFunctionLiteralType() { - if (at(COLON)) { - advance(); // COLON - if (at(ARROW)) { - error("Expecting a type"); - } - else { - myJetParsing.parseTypeRef(); - } - } - } - - /** - * "(" (modifiers SimpleName (":" type)?){","} ")" - * - * @return true if at least one comma was found - */ - private boolean parseFunctionLiteralParameterList() { - PsiBuilder.Marker list = mark(); - expect(LPAR, "Expecting a parameter list in parentheses (...)", TokenSet.create(ARROW, COLON)); - - boolean hasComma = false; - - myBuilder.disableNewlines(); - - if (!at(RPAR)) { - while (true) { - if (at(COMMA)) errorAndAdvance("Expecting a parameter declaration"); - - PsiBuilder.Marker parameter = mark(); - int parameterNamePos = matchTokenStreamPredicate(new LastBefore(new At(IDENTIFIER), new AtSet(COMMA, RPAR, COLON, ARROW, RBRACE, LBRACE))); - createTruncatedBuilder(parameterNamePos).parseModifierList(ONLY_ESCAPED_REGULAR_ANNOTATIONS); - - expect(IDENTIFIER, "Expecting parameter declaration"); - - if (at(COLON)) { - advance(); // COLON - myJetParsing.parseTypeRef(); - } - parameter.done(VALUE_PARAMETER); - if (!at(COMMA)) break; - advance(); // COMMA - - hasComma = true; - - if (at(RPAR)) { - error("Expecting a parameter declaration"); - break; - } - } - } - - myBuilder.restoreNewlinesState(); - - expect(RPAR, "Expecting ')'", TokenSet.create(ARROW, COLON)); - list.done(VALUE_PARAMETER_LIST); - - return hasComma; - } - /* * expressions * : SEMI* statement{SEMI+} SEMI* diff --git a/compiler/testData/psi/CallsInWhen.kt b/compiler/testData/psi/CallsInWhen.kt index 4cacfb5fff4..daf2ea472ee 100644 --- a/compiler/testData/psi/CallsInWhen.kt +++ b/compiler/testData/psi/CallsInWhen.kt @@ -7,7 +7,7 @@ fun foo() { a.foo(a, d) -> a a.{bar} -> a a.{!bar} -> a - a.{() -> !bar} -> a + a.{ -> !bar} -> a else -> a } } diff --git a/compiler/testData/psi/CallsInWhen.txt b/compiler/testData/psi/CallsInWhen.txt index 37d924ca01f..e5cce93858d 100644 --- a/compiler/testData/psi/CallsInWhen.txt +++ b/compiler/testData/psi/CallsInWhen.txt @@ -192,10 +192,9 @@ JetFile: CallsInWhen.kt FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK diff --git a/compiler/testData/psi/FunctionLiterals.txt b/compiler/testData/psi/FunctionLiterals.txt index a272594a566..ef1e3f28a75 100644 --- a/compiler/testData/psi/FunctionLiterals.txt +++ b/compiler/testData/psi/FunctionLiterals.txt @@ -46,396 +46,416 @@ JetFile: FunctionLiterals.kt FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') BLOCK - REFERENCE_EXPRESSION + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') + BLOCK + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_WITH_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + BINARY_WITH_TYPE + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_WITH_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') + BLOCK + BINARY_WITH_TYPE + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + OPERATION_REFERENCE + PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('B') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE + PARENTHESIZED + PsiElement(LPAR)('(') REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiErrorElement:Expecting ')' + + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER + BLOCK + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_WITH_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiErrorElement:Expecting ')' + + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('B') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('B') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') BLOCK - REFERENCE_EXPRESSION + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_WITH_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiErrorElement:Expecting ')' + + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiErrorElement:Expecting ')' + + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('B') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') BLOCK - REFERENCE_EXPRESSION + PARENTHESIZED + PsiElement(LPAR)('(') + PsiErrorElement:Expecting an expression + + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') BLOCK - REFERENCE_EXPRESSION + PARENTHESIZED + PsiElement(LPAR)('(') + PsiErrorElement:Expecting an expression + + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') BLOCK - REFERENCE_EXPRESSION + BINARY_WITH_TYPE + PARENTHESIZED + PsiElement(LPAR)('(') + PsiErrorElement:Expecting an expression + + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') BLOCK - REFERENCE_EXPRESSION + BINARY_WITH_TYPE + PARENTHESIZED + PsiElement(LPAR)('(') + PsiErrorElement:Expecting an expression + + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE + BLOCK + DOT_QUALIFIED_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION + PsiElement(DOT)('.') + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE + BLOCK + DOT_QUALIFIED_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') + PsiElement(DOT)('.') + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_WITH_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + BINARY_WITH_TYPE + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(DOT)('.') + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_WITH_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') + BLOCK + BINARY_WITH_TYPE + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(DOT)('.') + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + OPERATION_REFERENCE + PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') @@ -501,21 +521,25 @@ JetFile: FunctionLiterals.kt FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - TYPE_REFERENCE - PsiElement(LPAR)('(') - FUNCTION_TYPE - VALUE_PARAMETER_LIST + BLOCK + PARENTHESIZED + PsiElement(LPAR)('(') + PARENTHESIZED PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(COLON)(':') + BINARY_EXPRESSION + BINARY_WITH_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') + OPERATION_REFERENCE + PsiElement(EQ)('=') PsiWhiteSpace(' ') OBJECT_LITERAL OBJECT_DECLARATION @@ -538,38 +562,28 @@ JetFile: FunctionLiterals.kt PsiWhiteSpace(' ') PsiElement(RBRACE)('}') PsiElement(RPAR)(')') - PsiWhiteSpace(' ') + PsiErrorElement:Expecting ')' + + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) PsiElement(ARROW)('->') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiElement(DOT)('.') + PsiElement(LPAR)('(') PsiElement(IDENTIFIER)('x') PsiElement(COLON)(':') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('String') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - STRING_TEMPLATE + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('String') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(OPEN_QUOTE)('"') PsiElement(CLOSING_QUOTE)('"') PsiWhiteSpace(' ') @@ -579,95 +593,91 @@ JetFile: FunctionLiterals.kt FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - USER_TYPE + BLOCK + DOT_QUALIFIED_EXPRESSION + DOT_QUALIFIED_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('A') + PsiElement(DOT)('.') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('String') + PsiElement(GT)('>') PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('B') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_WITH_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('String') - PsiElement(GT)('>') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - TYPE_REFERENCE - PsiElement(LPAR)('(') - FUNCTION_TYPE - VALUE_PARAMETER_LIST + BLOCK + PARENTHESIZED + PsiElement(LPAR)('(') + PARENTHESIZED PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(COLON)(':') + BINARY_EXPRESSION + BINARY_WITH_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Boolean') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Boolean') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') + OPERATION_REFERENCE + PsiElement(EQ)('=') PsiWhiteSpace(' ') BOOLEAN_CONSTANT PsiElement(true)('true') PsiElement(RPAR)(')') - PsiWhiteSpace(' ') + PsiErrorElement:Expecting ')' + + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) PsiElement(ARROW)('->') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') + PsiElement(DOT)('.') + PsiElement(LPAR)('(') PsiElement(IDENTIFIER)('x') PsiElement(COLON)(':') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Any') - PsiElement(RPAR)(')') + PsiElement(IDENTIFIER)('Any') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('Unit') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Unit') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') FUNCTION_LITERAL_EXPRESSION diff --git a/compiler/testData/psi/FunctionLiterals_ERR.txt b/compiler/testData/psi/FunctionLiterals_ERR.txt index 868396a8fd3..c4d74aa098b 100644 --- a/compiler/testData/psi/FunctionLiterals_ERR.txt +++ b/compiler/testData/psi/FunctionLiterals_ERR.txt @@ -30,187 +30,193 @@ JetFile: FunctionLiterals_ERR.kt FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiErrorElement:Expecting ')' - - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') BLOCK - REFERENCE_EXPRESSION + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiErrorElement:Expecting ')' + + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - PsiErrorElement:Type expected - - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') BLOCK - REFERENCE_EXPRESSION + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_WITH_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') + BLOCK + BINARY_EXPRESSION + BINARY_WITH_TYPE + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_WITH_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + PsiErrorElement:Type expected + PsiElement(ARROW)('->') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + OPERATION_REFERENCE + PsiElement(IDENTIFIER)('a') + PsiErrorElement:Expecting an element + + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + BINARY_WITH_TYPE + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(RPAR)(')') + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiErrorElement:Expecting a type - - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(COMMA)(',') - PsiErrorElement:Expecting a parameter declaration - - PsiWhiteSpace(' ') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting a parameter declaration - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('B') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting a parameter declaration - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiErrorElement:Expecting parameter declaration - - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE + PARENTHESIZED + PsiElement(LPAR)('(') REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiErrorElement:Expecting ')' + + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') BLOCK - REFERENCE_EXPRESSION + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_WITH_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiErrorElement:Expecting ')' + + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('B') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_WITH_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiErrorElement:Expecting ')' + + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') @@ -401,99 +407,91 @@ JetFile: FunctionLiterals_ERR.kt FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiErrorElement:Expecting a parameter list in parentheses (...) - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiErrorElement:Expecting parameter declaration - - PsiElement(COLON)(':') + BLOCK + BINARY_WITH_TYPE + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('b') - PsiErrorElement:Expecting ')' - - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('f') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('b') - PsiElement(RPAR)(')') - PsiErrorElement:An -> is expected - - PsiWhiteSpace(' ') BLOCK - + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiErrorElement:Expecting ')' + + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('b') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE + BLOCK + DOT_QUALIFIED_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER + PsiElement(DOT)('.') + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiErrorElement:Expecting ')' + + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('b') - PsiElement(RPAR)(')') - PsiErrorElement:An -> is expected - + PsiElement(RPAR)(')') PsiWhiteSpace(' ') - BLOCK - PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiErrorElement:Expecting a parameter declaration - - PsiWhiteSpace(' ') - PsiElement(RPAR)(')') - PsiErrorElement:An -> is expected - BLOCK - + PARENTHESIZED + PsiElement(LPAR)('(') + BINARY_WITH_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + OPERATION_REFERENCE + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiErrorElement:Expecting ')' + + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiElement(RPAR)(')') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') FUNCTION_LITERAL_EXPRESSION diff --git a/compiler/testData/psi/examples/FunctionsAndTypes.kt b/compiler/testData/psi/examples/FunctionsAndTypes.kt index b5098ae406f..b9f67b47382 100644 --- a/compiler/testData/psi/examples/FunctionsAndTypes.kt +++ b/compiler/testData/psi/examples/FunctionsAndTypes.kt @@ -22,11 +22,9 @@ typealias Function1 = (input : T) -> R //type Function1 = {(input : T) => R} -val f1 = {(t : T) : X -> something(t)} fun f1(t : T) : X = something(t) -val f1 = {(t : T) -> something(t)} -val f1 = {(T) : X -> something(it)} +val f1 = {t : T -> something(t)} val f1 = {t -> something(t)} val f1 = {something(it)} diff --git a/compiler/testData/psi/examples/FunctionsAndTypes.txt b/compiler/testData/psi/examples/FunctionsAndTypes.txt index ab777d2f2dd..cf1c9a1fbc3 100644 --- a/compiler/testData/psi/examples/FunctionsAndTypes.txt +++ b/compiler/testData/psi/examples/FunctionsAndTypes.txt @@ -407,50 +407,6 @@ JetFile: FunctionsAndTypes.kt PsiWhiteSpace('\n') PsiComment(EOL_COMMENT)('//type Function1 = {(input : T) => R}') PsiWhiteSpace('\n\n\n') - PROPERTY - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f1') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('t') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('X') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('something') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(RPAR)(')') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') FUN PsiElement(fun)('fun') PsiWhiteSpace(' ') @@ -498,7 +454,6 @@ JetFile: FunctionsAndTypes.kt FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') VALUE_PARAMETER PsiElement(IDENTIFIER)('t') PsiWhiteSpace(' ') @@ -508,7 +463,6 @@ JetFile: FunctionsAndTypes.kt USER_TYPE REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') - PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(ARROW)('->') PsiWhiteSpace(' ') @@ -524,43 +478,6 @@ JetFile: FunctionsAndTypes.kt PsiElement(RPAR)(')') PsiElement(RBRACE)('}') PsiWhiteSpace('\n') - PROPERTY - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('f1') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('T') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('X') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('something') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('it') - PsiElement(RPAR)(')') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') PROPERTY PsiElement(val)('val') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/examples/LINQ.kt b/compiler/testData/psi/examples/LINQ.kt index efffad662fd..b4479750b93 100644 --- a/compiler/testData/psi/examples/LINQ.kt +++ b/compiler/testData/psi/examples/LINQ.kt @@ -1,3 +1,3 @@ fun foo() { - l filter {it.x} map {it.foo} aggregate {(a, b) -> a + b} + l filter {it.x} map {it.foo} aggregate {a, b -> a + b} } \ No newline at end of file diff --git a/compiler/testData/psi/examples/LINQ.txt b/compiler/testData/psi/examples/LINQ.txt index 1602e6697b3..7f3016c6b31 100644 --- a/compiler/testData/psi/examples/LINQ.txt +++ b/compiler/testData/psi/examples/LINQ.txt @@ -57,14 +57,12 @@ JetFile: LINQ.kt FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') VALUE_PARAMETER PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') VALUE_PARAMETER PsiElement(IDENTIFIER)('b') - PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(ARROW)('->') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/examples/util/Comparison.kt b/compiler/testData/psi/examples/util/Comparison.kt index d1dcb2e4ef6..a9cd6696260 100644 --- a/compiler/testData/psi/examples/util/Comparison.kt +++ b/compiler/testData/psi/examples/util/Comparison.kt @@ -10,7 +10,7 @@ enum class ComparisonResult { typealias MatchableComparison = (T, T) -> ComparisonResult -fun asMatchableComparison(cmp : Comparison) : MatchableComparison = {(a, b) -> +fun asMatchableComparison(cmp : Comparison) : MatchableComparison = {a, b -> val res = cmp(a, b) if (res == 0) return ComparisonResult.EQ if (res < 0) return ComparisonResult.LS diff --git a/compiler/testData/psi/examples/util/Comparison.txt b/compiler/testData/psi/examples/util/Comparison.txt index dadf55c160c..36f67392a75 100644 --- a/compiler/testData/psi/examples/util/Comparison.txt +++ b/compiler/testData/psi/examples/util/Comparison.txt @@ -324,14 +324,12 @@ JetFile: Comparison.kt FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') VALUE_PARAMETER PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') VALUE_PARAMETER PsiElement(IDENTIFIER)('b') - PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(ARROW)('->') PsiWhiteSpace('\n ') diff --git a/compiler/testData/psi/greatSyntacticShift/functionLiterals.kt b/compiler/testData/psi/greatSyntacticShift/functionLiterals.kt index d285bdd7e8f..1c5601d26a2 100644 --- a/compiler/testData/psi/greatSyntacticShift/functionLiterals.kt +++ b/compiler/testData/psi/greatSyntacticShift/functionLiterals.kt @@ -12,32 +12,7 @@ a(1 , {-> 1} , {x -> 1} , {x, y -> 1} -, {(x, y) -> 1} -, {(x, y) : Int -> 1} -, {(x) -> 1} -, {(x) : Int -> 1} +, {x -> 1} , {(x)} -, {(x).(y)} -, {x.(y)} -, {Int.(x) -> 1} -, {A.B.(x) -> 1} -, {A.B.(x, y) -> 1} -, {Int.(x) : Int -> 1} -, {Int.(x, y) -> 1} -, {Int.(x, y) : Int -> 1} -, {(Int).(x, y) -> 1} -, {(Int).(x, y) : Int -> 1} -, {(Int).(x, y) : (Int) -> Int -> {1}} -, {Int? .(x, y) -> 1} -, {This.(x, y) -> 1} -, {Pair(A, B).(x, y) -> 1} -, {Pair(a, b).(y)} -, {Pair(a, b)} -, {Foo.x} -, {Foo.(x)} -, {Foo.(x) -> x} -, {Foo.Bar.Baz.(x) -> x} -, {Foo.(x) : Int -> x} -, {Foo.Bar.Baz.(x) : Int -> x} ) } diff --git a/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt b/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt index 75e1834c277..a785bbcead7 100644 --- a/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt +++ b/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt @@ -166,89 +166,8 @@ JetFile: functionLiterals.kt FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') VALUE_PARAMETER PsiElement(IDENTIFIER)('x') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('y') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('y') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') PsiWhiteSpace(' ') PsiElement(ARROW)('->') PsiWhiteSpace(' ') @@ -271,689 +190,6 @@ JetFile: functionLiterals.kt PsiElement(RPAR)(')') PsiElement(RBRACE)('}') PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - BLOCK - DOT_QUALIFIED_EXPRESSION - PARENTHESIZED - PsiElement(LPAR)('(') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RPAR)(')') - PsiElement(DOT)('.') - PARENTHESIZED - PsiElement(LPAR)('(') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('y') - PsiElement(RPAR)(')') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - BLOCK - DOT_QUALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(DOT)('.') - PARENTHESIZED - PsiElement(LPAR)('(') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('y') - PsiElement(RPAR)(')') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('B') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('B') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('y') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('y') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('y') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - PsiElement(LPAR)('(') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('y') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - PsiElement(LPAR)('(') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('y') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - PsiElement(LPAR)('(') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('y') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - FUNCTION_TYPE - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - BLOCK - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(RBRACE)('}') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - NULLABLE_TYPE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(QUEST)('?') - PsiWhiteSpace(' ') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('y') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - SELF_TYPE - PsiElement(This)('This') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('y') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - BLOCK - DOT_QUALIFIED_EXPRESSION - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Pair') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('B') - PsiElement(RPAR)(')') - PsiElement(DOT)('.') - PARENTHESIZED - PsiElement(LPAR)('(') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiErrorElement:Expecting ')' - - PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('y') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - PsiElement(INTEGER_LITERAL)('1') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - BLOCK - DOT_QUALIFIED_EXPRESSION - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Pair') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('b') - PsiElement(RPAR)(')') - PsiElement(DOT)('.') - PARENTHESIZED - PsiElement(LPAR)('(') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('y') - PsiElement(RPAR)(')') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - BLOCK - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Pair') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('b') - PsiElement(RPAR)(')') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - BLOCK - DOT_QUALIFIED_EXPRESSION - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Foo') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Bar') - PsiElement(GT)('>') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - BLOCK - DOT_QUALIFIED_EXPRESSION - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Foo') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Bar') - PsiElement(GT)('>') - PsiElement(DOT)('.') - PARENTHESIZED - PsiElement(LPAR)('(') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RPAR)(')') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Foo') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Bar') - PsiElement(GT)('>') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - USER_TYPE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Foo') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Bar') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Baz') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Foo') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Bar') - PsiElement(GT)('>') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - USER_TYPE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Foo') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Bar') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Baz') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') PsiElement(RPAR)(')') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') diff --git a/grammar/src/expressions.grm b/grammar/src/expressions.grm index 5fe20aee6bb..94363961b48 100644 --- a/grammar/src/expressions.grm +++ b/grammar/src/expressions.grm @@ -256,7 +256,6 @@ jump functionLiteral : "{" statements "}" : "{" (modifiers SimpleName){","} "->" statements "}" - : "{" (type ".")? "(" (modifiers SimpleName (":" type)?){","} ")" (":" type)? "->" statements "}" ; statements diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ModuleDependencyMapper.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ModuleDependencyMapper.kt index 552d462a144..12f5ea1019c 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ModuleDependencyMapper.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ModuleDependencyMapper.kt @@ -64,7 +64,7 @@ fun createModuleResolverProvider( val resolverForProject = analyzerFacade.setupResolverForProject( globalContext.withProject(project), modulesToCreateResolversFor, modulesContent, jvmPlatformParameters, IdeaEnvironment, delegateResolver, - { (m, c) -> IDEPackagePartProvider(c.moduleContentScope) } + { m, c -> IDEPackagePartProvider(c.moduleContentScope) } ) return resolverForProject }