mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-17 20:11:25 +07:00
[python] Fix nullability annotations (PyAstNumericLiteralExpression)
GitOrigin-RevId: d5db0add83ac134aab91198b1a931c026829d216
This commit is contained in:
committed by
intellij-monorepo-bot
parent
38ee9327a6
commit
7f22ee443e
@@ -115,13 +115,11 @@ public final class PyDictDuplicateKeysInspection extends PyInspection {
|
||||
|
||||
if (node instanceof PyNumericLiteralExpression) {
|
||||
final BigDecimal value = ((PyNumericLiteralExpression)node).getBigDecimalValue();
|
||||
if (value != null) {
|
||||
final String keyValue = value.toPlainString();
|
||||
return !value.equals(BigDecimal.ZERO) &&
|
||||
myTypeEvalContext.getType((PyNumericLiteralExpression)node) == PyBuiltinCache.getInstance(node).getComplexType()
|
||||
? keyValue + "j"
|
||||
: keyValue;
|
||||
}
|
||||
final String keyValue = value.toPlainString();
|
||||
return !value.equals(BigDecimal.ZERO) &&
|
||||
myTypeEvalContext.getType((PyNumericLiteralExpression)node) == PyBuiltinCache.getInstance(node).getComplexType()
|
||||
? keyValue + "j"
|
||||
: keyValue;
|
||||
}
|
||||
|
||||
return node instanceof PyLiteralExpression || node instanceof PyReferenceExpression ? node.getText() : null;
|
||||
|
||||
@@ -128,9 +128,7 @@ public class PyEvaluator {
|
||||
private static Object evaluateNumeric(@NotNull PyNumericLiteralExpression expression) {
|
||||
if (expression.isIntegerLiteral()) {
|
||||
final BigInteger value = expression.getBigIntegerValue();
|
||||
if (value != null) {
|
||||
return fromBigInteger(value);
|
||||
}
|
||||
return fromBigInteger(value);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user