Added parser test for function with initializer.

This commit is contained in:
Stanislav Erokhin
2015-03-13 20:25:58 +03:00
parent 446816e3db
commit 7a8341d0f1
4 changed files with 31 additions and 2 deletions
+2 -1
View File
@@ -19,4 +19,5 @@ fun [a()] T.foo<T : (a) -> b>(a : foo) : bar {}
fun [a()] T.foo<T : [a] (a) -> b>(a : foo) : bar {}
fun A?.foo() : bar?
fun A? .foo() : bar?
fun A? .foo() : bar?
fun foo() = 5
+14 -1
View File
@@ -622,4 +622,17 @@ JetFile: Functions.kt
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar')
PsiElement(QUEST)('?')
PsiElement(QUEST)('?')
PsiWhiteSpace('\n')
FUN
PsiElement(fun)('fun')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('foo')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(EQ)('=')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('5')
+1
View File
@@ -6,3 +6,4 @@ fun [a()] T.foo<, T, , T>(a : foo) : bar
fun [a()] T.foo<T, T>(, a : foo, , a: b) : bar
fun foo() : = a;
fun foo() = ;
+14
View File
@@ -290,4 +290,18 @@ JetFile: Functions_ERR.kt
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiElement(SEMICOLON)(';')
PsiWhiteSpace('\n')
FUN
PsiElement(fun)('fun')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('foo')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(EQ)('=')
PsiErrorElement:Expecting an expression
<empty list>
PsiWhiteSpace(' ')
PsiElement(SEMICOLON)(';')