Merge branch 'fix-ternary-with-type' of github.com:vladyan18/slither into vladyan18-fix-ternary-with-type

pull/1306/head
Josselin Feist 2 years ago
commit 9567b69418
  1. 6
      slither/utils/expression_manipulations.py

@ -9,6 +9,7 @@ from slither.core.expressions.assignment_operation import AssignmentOperation
from slither.core.expressions.binary_operation import BinaryOperation
from slither.core.expressions.call_expression import CallExpression
from slither.core.expressions.conditional_expression import ConditionalExpression
from slither.core.expressions.elementary_type_name_expression import ElementaryTypeNameExpression
from slither.core.expressions.expression import Expression
from slither.core.expressions.identifier import Identifier
from slither.core.expressions.index_access import IndexAccess
@ -80,7 +81,10 @@ class SplitTernaryExpression:
if isinstance(expression, ConditionalExpression):
raise SlitherException("Nested ternary operator not handled")
if isinstance(expression, (Literal, Identifier, IndexAccess, NewArray, NewContract)):
if isinstance(
expression,
(Literal, Identifier, IndexAccess, NewArray, NewContract, ElementaryTypeNameExpression),
):
return
# case of lib

Loading…
Cancel
Save