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.
pull/6736/head
Dylan Baker 5 years ago
parent 581d69a8d3
commit 08797e13d9
  1. 4
      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]

Loading…
Cancel
Save