modules: make ReturnValue.new_objects covariant

Otherwise we have to do a lot of casting to ensure that we get the
appropriate invariant type
pull/9333/head
Dylan Baker 3 years ago
parent 4deeb907b6
commit c4aa8c2521
  1. 2
      mesonbuild/modules/__init__.py

@ -185,7 +185,7 @@ def is_module_library(fname):
class ModuleReturnValue:
def __init__(self, return_value: T.Optional['TYPE_var'], new_objects: T.List['TYPE_var']) -> None:
def __init__(self, return_value: T.Optional['TYPE_var'], new_objects: T.Sequence['TYPE_var']) -> None:
self.return_value = return_value
assert isinstance(new_objects, list)
self.new_objects = new_objects

Loading…
Cancel
Save