Import type parsing for Solidity 0.8 (fix #807)

pull/817/head
Josselin 4 years ago
parent 3261ca1a65
commit 61499d6125
  1. 16
      slither/solc_parsing/solidity_types/type_parsing.py

@ -14,6 +14,7 @@ from slither.core.solidity_types.mapping_type import MappingType
from slither.core.solidity_types.type import Type
from slither.core.solidity_types.user_defined_type import UserDefinedType
from slither.core.variables.function_type_variable import FunctionTypeVariable
from slither.exceptions import SlitherError
from slither.solc_parsing.exceptions import ParsingError
if TYPE_CHECKING:
@ -291,6 +292,21 @@ def parse_type(t: Union[Dict, UnknownType], caller_context):
all_enums,
)
# Introduced with Solidity 0.8
if t[key] == "IdentifierPath":
if is_compact_ast:
return _find_from_type_name(
t["name"],
functions,
contracts,
structures_direct_access,
all_structures,
enums_direct_access,
all_enums,
)
raise SlitherError("Solidity 0.8 not supported with the legacy AST")
if t[key] == "ArrayTypeName":
length = None
if is_compact_ast:

Loading…
Cancel
Save