mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Lambda expressions support: drop generic lambda expressions
This commit is contained in:
-5
@@ -26,16 +26,11 @@ class C {
|
||||
int parse(String s);
|
||||
}
|
||||
|
||||
interface ListProducer<T> {
|
||||
List<T> produce();
|
||||
}
|
||||
|
||||
void test() {
|
||||
Simplest simplest = <weak_warning descr="Lambda expressions type check is not yet implemented">() -> { }</weak_warning>;
|
||||
use(<weak_warning descr="Lambda expressions type check is not yet implemented">() -> { }</weak_warning>);
|
||||
|
||||
IntParser intParser = <weak_warning descr="Lambda expressions type check is not yet implemented">(String s) -> Integer.parseInt(s)</weak_warning>;
|
||||
ListProducer<String> listProducer = <weak_warning descr="Lambda expressions type check is not yet implemented"><T>() -> new ArrayList<T>()</weak_warning>;
|
||||
}
|
||||
|
||||
Runnable foo() {
|
||||
|
||||
@@ -1,33 +1,18 @@
|
||||
PsiJavaFile:LambdaExpression12.java
|
||||
PsiLambdaExpression:<T>() -> new C<T>()
|
||||
PsiTypeParameterList
|
||||
PsiJavaToken:LT('<')
|
||||
PsiTypeParameter:T
|
||||
PsiIdentifier:T('T')
|
||||
PsiElement(EXTENDS_BOUND_LIST)
|
||||
<empty list>
|
||||
PsiJavaToken:GT('>')
|
||||
PsiParameterList:()
|
||||
PsiJavaToken:LPARENTH('(')
|
||||
PsiJavaToken:RPARENTH(')')
|
||||
PsiErrorElement:Unparsed tokens
|
||||
PsiJavaToken:LT('<')
|
||||
PsiIdentifier:T('T')
|
||||
PsiJavaToken:GT('>')
|
||||
PsiJavaToken:LPARENTH('(')
|
||||
PsiJavaToken:RPARENTH(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:ARROW('->')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiNewExpression:new C<T>()
|
||||
PsiKeyword:new('new')
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaCodeReferenceElement:C<T>
|
||||
PsiIdentifier:C('C')
|
||||
PsiReferenceParameterList
|
||||
PsiJavaToken:LT('<')
|
||||
PsiTypeElement:T
|
||||
PsiJavaCodeReferenceElement:T
|
||||
PsiIdentifier:T('T')
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiJavaToken:GT('>')
|
||||
PsiExpressionList
|
||||
PsiJavaToken:LPARENTH('(')
|
||||
PsiJavaToken:RPARENTH(')')
|
||||
PsiKeyword:new('new')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiIdentifier:C('C')
|
||||
PsiJavaToken:LT('<')
|
||||
PsiIdentifier:T('T')
|
||||
PsiJavaToken:GT('>')
|
||||
PsiJavaToken:LPARENTH('(')
|
||||
PsiJavaToken:RPARENTH(')')
|
||||
@@ -1,21 +1,10 @@
|
||||
PsiJavaFile:LambdaExpression13.java
|
||||
PsiLambdaExpression:<T>t -> t
|
||||
PsiTypeParameterList
|
||||
PsiJavaToken:LT('<')
|
||||
PsiTypeParameter:T
|
||||
PsiIdentifier:T('T')
|
||||
PsiElement(EXTENDS_BOUND_LIST)
|
||||
<empty list>
|
||||
PsiJavaToken:GT('>')
|
||||
PsiParameterList:t
|
||||
PsiParameter:t
|
||||
PsiModifierList:
|
||||
<empty list>
|
||||
PsiIdentifier:t('t')
|
||||
PsiErrorElement:Unparsed tokens
|
||||
PsiJavaToken:LT('<')
|
||||
PsiIdentifier:T('T')
|
||||
PsiJavaToken:GT('>')
|
||||
PsiIdentifier:t('t')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:ARROW('->')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:t
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:t('t')
|
||||
PsiIdentifier:t('t')
|
||||
+2
-2
@@ -134,8 +134,8 @@ public class ExpressionParserTest extends JavaParsingTestCase {
|
||||
public void testLambdaExpression9() { doParserTest("(I)p -> null"); }
|
||||
public void testLambdaExpression10() { doParserTest("(I)(p -> null)"); }
|
||||
public void testLambdaExpression11() { doParserTest("() -> { }"); }
|
||||
public void testLambdaExpression12() { doParserTest("<T>() -> new C<T>()"); }
|
||||
public void testLambdaExpression13() { doParserTest("<T>t -> t"); }
|
||||
public void testLambdaExpression12() { doParserTest("<T>() -> new C<T>()"); } // these two expressions
|
||||
public void testLambdaExpression13() { doParserTest("<T>t -> t"); } // should no longer be parsed
|
||||
public void testLambdaExpression14() { doParserTest("(String t) -> t"); }
|
||||
public void testLambdaExpression15() { doParserTest("(int a, int b) -> a + b"); }
|
||||
public void testLambdaExpression16() { doParserTest("(final int x) -> x"); }
|
||||
|
||||
Reference in New Issue
Block a user