mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
get back old isDenotableType and deprecate it
This commit is contained in:
@@ -321,9 +321,17 @@ public class PsiTypesUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context in which type should be checked
|
||||
* @return false if type is null or has no explicit canonical type representation (e. g. intersection type)
|
||||
* Not compliant to specification, use {@link PsiTypesUtil#isDenotableType(PsiType, PsiElement)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean isDenotableType(@Nullable PsiType type) {
|
||||
return !(type instanceof PsiWildcardType || type instanceof PsiCapturedWildcardType);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context in which type should be checked
|
||||
* @return false if type is null or has no explicit canonical type representation (e. g. intersection type)
|
||||
*/
|
||||
public static boolean isDenotableType(@Nullable PsiType type, @NotNull PsiElement context) {
|
||||
if (type == null) return false;
|
||||
PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(context.getProject());
|
||||
|
||||
+2
-2
@@ -161,9 +161,9 @@ object LambdaToAnonymousTransformer : PsiElementTransformer.Base() {
|
||||
val interfaceMethod = LambdaUtil.getFunctionalInterfaceMethod(functionalInterfaceType)
|
||||
if (interfaceMethod != null) {
|
||||
val substitutor = LambdaUtil.getSubstitutor(interfaceMethod, PsiUtil.resolveGenericsClassInType(functionalInterfaceType))
|
||||
if (interfaceMethod.getSignature(substitutor).parameterTypes.any { !PsiTypesUtil.isDenotableType(it, lambdaExpression) }) return false
|
||||
if (interfaceMethod.getSignature(substitutor).parameterTypes.any { !PsiTypesUtil.isDenotableType(it) }) return false
|
||||
val returnType = LambdaUtil.getFunctionalInterfaceReturnType(functionalInterfaceType)
|
||||
return PsiTypesUtil.isDenotableType(returnType, lambdaExpression)
|
||||
return PsiTypesUtil.isDenotableType(returnType)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user