mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-179716 Cannot return Integer from method returning short. Fix docs.
This commit is contained in:
+1
-1
@@ -795,7 +795,7 @@ public class GroovyTypeCheckVisitor extends BaseInspectionVisitor {
|
||||
);
|
||||
}
|
||||
|
||||
//copypaste from org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.checkPossibleLooseOfPrecision()
|
||||
//see org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.checkPossibleLooseOfPrecision()
|
||||
static boolean isPossibleLooseOfPrecision(@NotNull PsiType targetType, @NotNull PsiType actualType, @NotNull GrExpression expression) {
|
||||
int targetRank = getTypeRank(targetType);
|
||||
int actualRank = getTypeRank(actualType);
|
||||
|
||||
+4
-3
@@ -36,9 +36,10 @@ public class GrContainerTypeConverter extends GrTypeConverter {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static ConversionResult isCSConvertible(PsiType targetType,
|
||||
PsiType actualType,
|
||||
GroovyPsiElement context) {
|
||||
@Nullable
|
||||
private static ConversionResult isCSConvertible(@NotNull PsiType targetType,
|
||||
@NotNull PsiType actualType,
|
||||
@NotNull GroovyPsiElement context) {
|
||||
if (targetType instanceof PsiArrayType && actualType instanceof PsiArrayType) {
|
||||
return TypesUtil.isAssignableByParameter(((PsiArrayType)targetType).getComponentType(), ((PsiArrayType)actualType).getComponentType(),
|
||||
context) ? ConversionResult.OK : ConversionResult.ERROR;
|
||||
|
||||
+3
-2
@@ -28,14 +28,15 @@ public class GrNumberConverter extends GrTypeConverter {
|
||||
@NotNull PsiType actualType,
|
||||
@NotNull GroovyPsiElement context,
|
||||
@NotNull ApplicableTo currentPosition) {
|
||||
if (PsiUtil.isCompileStatic(context)) return isCSConvertible(targetType, actualType, context, currentPosition);
|
||||
if (PsiUtil.isCompileStatic(context)) return isCSConvertible(targetType, actualType);
|
||||
if (TypesUtil.isNumericType(targetType) && TypesUtil.isNumericType(actualType)) {
|
||||
return OK;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static ConversionResult isCSConvertible(PsiType targetType, PsiType actualType, GroovyPsiElement context, @NotNull ApplicableTo currentPosition) {
|
||||
@Nullable
|
||||
private static ConversionResult isCSConvertible(@NotNull PsiType targetType, @NotNull PsiType actualType) {
|
||||
|
||||
if (TypesUtil.isClassType(actualType, JAVA_MATH_BIG_DECIMAL))
|
||||
return isFloatOrDoubleType(targetType) ? OK : null;
|
||||
|
||||
Reference in New Issue
Block a user