Empty parameter list should go before '->' in a lambda
Example:
val x = { -> foo() }
This commit is contained in:
@@ -976,8 +976,8 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
||||
|
||||
if (at(ARROW)) {
|
||||
// { -> ...}
|
||||
advance(); // ARROW
|
||||
mark().done(VALUE_PARAMETER_LIST);
|
||||
advance(); // ARROW
|
||||
paramsFound = true;
|
||||
}
|
||||
else if (at(LPAR)) {
|
||||
|
||||
@@ -16,10 +16,10 @@ JetFile: FunctionLiterals_ERR.kt
|
||||
FUNCTION_LITERAL
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(ARROW)('->')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_PARAMETER_LIST
|
||||
<empty list>
|
||||
PsiElement(ARROW)('->')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
|
||||
@@ -73,10 +73,10 @@ JetFile: functionLiterals.kt
|
||||
FUNCTION_LITERAL
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(ARROW)('->')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_PARAMETER_LIST
|
||||
<empty list>
|
||||
PsiElement(ARROW)('->')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('1')
|
||||
@@ -110,10 +110,10 @@ JetFile: functionLiterals.kt
|
||||
FUNCTION_LITERAL_EXPRESSION
|
||||
FUNCTION_LITERAL
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(ARROW)('->')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_PARAMETER_LIST
|
||||
<empty list>
|
||||
PsiElement(ARROW)('->')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
INTEGER_CONSTANT
|
||||
PsiElement(INTEGER_LITERAL)('1')
|
||||
|
||||
Reference in New Issue
Block a user