Added parser test for function with initializer.
This commit is contained in:
@@ -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()] T.foo<T : [a] (a) -> b>(a : foo) : bar {}
|
||||||
|
|
||||||
fun A?.foo() : bar?
|
fun A?.foo() : bar?
|
||||||
fun A? .foo() : bar?
|
fun A? .foo() : bar?
|
||||||
|
fun foo() = 5
|
||||||
@@ -622,4 +622,17 @@ JetFile: Functions.kt
|
|||||||
USER_TYPE
|
USER_TYPE
|
||||||
REFERENCE_EXPRESSION
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(IDENTIFIER)('bar')
|
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')
|
||||||
@@ -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 [a()] T.foo<T, T>(, a : foo, , a: b) : bar
|
||||||
|
|
||||||
fun foo() : = a;
|
fun foo() : = a;
|
||||||
|
fun foo() = ;
|
||||||
@@ -290,4 +290,18 @@ JetFile: Functions_ERR.kt
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
REFERENCE_EXPRESSION
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(IDENTIFIER)('a')
|
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)(';')
|
PsiElement(SEMICOLON)(';')
|
||||||
Reference in New Issue
Block a user