Add typing to ModuleState machine members
@@ -22,7 +22,7 @@ from ..mesonlib import relpath, HoldableObject
from ..interpreterbase.decorators import noKwargs, noPosargs
if T.TYPE_CHECKING:
- from ..interpreter import Interpreter
+ from ..interpreter import Interpreter, MachineHolder
from ..interpreterbase import TYPE_var, TYPE_kwargs
from ..programs import ExternalProgram
@@ -55,9 +55,9 @@ class ModuleState:
self.man = interpreter.build.get_man()
self.global_args = interpreter.build.global_args.host
self.project_args = interpreter.build.projects_args.host.get(interpreter.subproject, {})
- self.build_machine = interpreter.builtin['build_machine'].held_object
- self.host_machine = interpreter.builtin['host_machine'].held_object
- self.target_machine = interpreter.builtin['target_machine'].held_object
+ self.build_machine = T.cast('MachineHolder', interpreter.builtin['build_machine']).held_object
+ self.host_machine = T.cast('MachineHolder', interpreter.builtin['host_machine']).held_object
+ self.target_machine = T.cast('MachineHolder', interpreter.builtin['target_machine']).held_object
self.current_node = interpreter.current_node
def get_include_args(self, include_dirs: T.Iterable[T.Union[str, build.IncludeDirs]], prefix: str = '-I') -> T.List[str]:
