mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
functional interface: introduce acceptability for both lambda and method references
This commit is contained in:
@@ -25,4 +25,9 @@ public interface PsiFunctionalExpression extends PsiExpression, Iconable, Naviga
|
||||
*/
|
||||
@Nullable
|
||||
PsiType getFunctionalInterfaceType();
|
||||
|
||||
/**
|
||||
* @return true if assignment SAM s = expr is correctly shaped
|
||||
*/
|
||||
boolean isAcceptable(PsiType left);
|
||||
}
|
||||
|
||||
+5
@@ -167,6 +167,11 @@ public class PsiLambdaExpressionImpl extends ExpressionPsiElement implements Psi
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptable(PsiType left) {
|
||||
return isAcceptable(left, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptable(PsiType leftType, boolean checkReturnType) {
|
||||
if (leftType instanceof PsiIntersectionType) {
|
||||
|
||||
Reference in New Issue
Block a user