aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-12-06 12:54:52 -0800
committerEli Schwartz <eschwartz93@gmail.com>2022-01-18 21:58:24 -0500
commit214ce0dc8b8a3617d0dc782c80efdc5d5ea0dca3 (patch)
treeec4810839a32ede5153019e254c0d3a13ece826a
parenta848dd3cce070a8d3b7c698704c6042c9431bdfe (diff)
downloadmeson-214ce0dc8b8a3617d0dc782c80efdc5d5ea0dca3.zip
meson-214ce0dc8b8a3617d0dc782c80efdc5d5ea0dca3.tar.gz
meson-214ce0dc8b8a3617d0dc782c80efdc5d5ea0dca3.tar.bz2
build: Fix return types of a couple of methods
These don't return `Target`, they return `BuildTarget | CustomTarget | CustomTargetIndex`
-rw-r--r--mesonbuild/backend/backends.py2
-rw-r--r--mesonbuild/build.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 957b259..e43c8c7 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -1058,7 +1058,7 @@ class Backend:
tests.
"""
result: T.Set[str] = set()
- prospectives: T.Set[build.Target] = set()
+ prospectives: T.Set[T.Union[build.BuildTarget, build.CustomTarget, build.CustomTargetIndex]] = set()
if isinstance(target, build.BuildTarget):
prospectives.update(target.get_transitive_link_deps())
# External deps
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 7cf0e3b..a392f98 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1001,11 +1001,11 @@ class BuildTarget(Target):
return ExtractedObjects(self, self.sources, self.generated, self.objects,
recursive)
- def get_all_link_deps(self) -> 'ImmutableListProtocol[Target]':
+ def get_all_link_deps(self) -> 'ImmutableListProtocol[T.Union[BuildTarget, CustomTarget, CustomTargetIndex]]':
return self.get_transitive_link_deps()
@lru_cache(maxsize=None)
- def get_transitive_link_deps(self) -> 'ImmutableListProtocol[Target]':
+ def get_transitive_link_deps(self) -> 'ImmutableListProtocol[T.Union[BuildTarget, CustomTarget, CustomTargetIndex]]':
result: T.List[Target] = []
for i in self.link_targets:
result += i.get_all_link_deps()