11from flatdata .generator .tree .nodes .node import Node
22from flatdata .generator .tree .nodes .references import EnumerationReference , ConstantValueReference , InvalidValueReference
33from flatdata .generator .tree .helpers .basictype import BasicType
4+ from flatdata .generator .tree .helpers .enumtype import EnumType
45
56from typing import Any
67
@@ -23,7 +24,7 @@ def __init__(self, name: str, properties: Any = None, type: str | None = None, o
2324 if type is not None :
2425 if not BasicType .is_basic_type (type ):
2526 self ._type_reference = EnumerationReference (type , width = self ._width )
26- self ._type : BasicType | Any | None = None
27+ self ._type : BasicType | EnumType | None = None
2728 self .insert (self ._type_reference )
2829 else :
2930 self ._type = BasicType (name = type , width = self ._width )
@@ -47,11 +48,11 @@ def range(self) -> str | None:
4748 return None
4849
4950 @property
50- def const_value_refs (self ) -> list [Any ]:
51+ def const_value_refs (self ) -> list [ConstantValueReference ]:
5152 return self .children_like (ConstantValueReference )
5253
5354 @property
54- def invalid_value (self ) -> Any :
55+ def invalid_value (self ) -> InvalidValueReference | None :
5556 for x in self .children_like (InvalidValueReference ):
5657 return x
5758 return None
@@ -61,11 +62,11 @@ def decorations(self) -> list[Any]:
6162 return self ._decorations
6263
6364 @property
64- def type (self ) -> Any :
65+ def type (self ) -> BasicType | EnumType | None :
6566 return self ._type
6667
6768 @type .setter
68- def type (self , value : Any ) -> None :
69+ def type (self , value : BasicType | EnumType | None ) -> None :
6970 self ._type = value
7071
7172 @property
0 commit comments