aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-03-04 13:20:54 -0800
committerDylan Baker <dylan@pnwbakers.com>2020-03-05 09:58:52 -0800
commit08797e13d9cdc5eaff3e16a816252e87eaa66057 (patch)
tree41193b8cdbacde22a0276b501be0ad3c6c6e76f1
parent581d69a8d3a726dea06e8bf0cd18bb901692b56f (diff)
downloadmeson-08797e13d9cdc5eaff3e16a816252e87eaa66057.zip
meson-08797e13d9cdc5eaff3e16a816252e87eaa66057.tar.gz
meson-08797e13d9cdc5eaff3e16a816252e87eaa66057.tar.bz2
dependencies: Use CompilerType not Compiler
Compiler is invariant, in other words Compiler and only Compiler can fulfull it, it's derived classes cannot be used. CompilerType is covariant, that is Compiler and any derived class can fulfill it. This fixes a number of issues in the boost module.
-rw-r--r--mesonbuild/dependencies/base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index 6f8181d..5f212e6 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -38,7 +38,7 @@ from ..mesonlib import Popen_safe, version_compare_many, version_compare, listif
from ..mesonlib import Version, LibType
if T.TYPE_CHECKING:
- from ..compilers.compilers import Compiler # noqa: F401
+ from ..compilers.compilers import CompilerType # noqa: F401
DependencyType = T.TypeVar('DependencyType', bound='Dependency')
# These must be defined in this file to avoid cyclical references.
@@ -2488,7 +2488,7 @@ def factory_methods(methods: T.Set[DependencyMethods]) -> 'FactoryType':
def detect_compiler(name: str, env: Environment, for_machine: MachineChoice,
- language: T.Optional[str]) -> T.Optional['Compiler']:
+ language: T.Optional[str]) -> T.Optional['CompilerType']:
"""Given a language and environment find the compiler used."""
compilers = env.coredata.compilers[for_machine]