@@ -53,7 +53,7 @@ def __init__(
53
53
self ._enumsNotParsed : List [Dict ] = []
54
54
self ._structuresNotParsed : List [Dict ] = []
55
55
self ._usingForNotParsed : List [Dict ] = []
56
- self ._customErrorParsed : List [Dict ] = []
56
+ self ._customErrorsNotParsed : List [Dict ] = []
57
57
58
58
self ._functions_parser : List [FunctionSolc ] = []
59
59
self ._modifiers_parser : List [ModifierSolc ] = []
@@ -277,13 +277,20 @@ def _parse_contract_items(self) -> None:
277
277
elif item [self .get_key ()] == "UsingForDirective" :
278
278
self ._usingForNotParsed .append (item )
279
279
elif item [self .get_key ()] == "ErrorDefinition" :
280
- self ._customErrorParsed .append (item )
280
+ self ._customErrorsNotParsed .append (item )
281
281
elif item [self .get_key ()] == "UserDefinedValueTypeDefinition" :
282
282
self ._parse_type_alias (item )
283
283
else :
284
284
raise ParsingError ("Unknown contract item: " + item [self .get_key ()])
285
285
return
286
286
287
+ def parse_type_alias (self ) -> None :
288
+ # We keep parse_ in the name just to keep the naming convention even if we already parsed them initially.
289
+ # Here we only update the current contract type_aliases_as_dict with the fathers' values
290
+ # It's useful to keep using the same pattern anyway as we know all the fathers have been analyzed
291
+ for father in self ._contract .inheritance_reverse :
292
+ self ._contract .type_aliases_as_dict .update (father .type_aliases_as_dict )
293
+
287
294
def _parse_type_alias (self , item : Dict ) -> None :
288
295
assert "name" in item
289
296
assert "underlyingType" in item
@@ -337,9 +344,9 @@ def parse_custom_errors(self) -> None:
337
344
for father in self ._contract .inheritance_reverse :
338
345
self ._contract .custom_errors_as_dict .update (father .custom_errors_as_dict )
339
346
340
- for custom_error in self ._customErrorParsed :
347
+ for custom_error in self ._customErrorsNotParsed :
341
348
self ._parse_custom_error (custom_error )
342
- self ._customErrorParsed = []
349
+ self ._customErrorsNotParsed = []
343
350
344
351
def parse_state_variables (self ) -> None :
345
352
for father in self ._contract .inheritance_reverse :
@@ -793,7 +800,7 @@ def delete_content(self) -> None:
793
800
self ._enumsNotParsed = []
794
801
self ._structuresNotParsed = []
795
802
self ._usingForNotParsed = []
796
- self ._customErrorParsed = []
803
+ self ._customErrorsNotParsed = []
797
804
798
805
def _handle_comment (self , attributes : Dict ) -> None :
799
806
"""
0 commit comments