summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2024-09-06 11:52:56 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2025-02-05 17:45:38 +0200
commit9fd5281befe7881c9d1210c9e6865382bc0f2b08 (patch)
tree45530ef9752f3537f23dd564f2fb6c657417fc0f /mesonbuild/compilers
parent8eba69cbaaa6498ecb0a43fac64e81b7f764d572 (diff)
downloadmeson-9fd5281befe7881c9d1210c9e6865382bc0f2b08.tar.gz
options: Replace uses of `UserOption[T.Any]` with a Union of UserOption types
The fact that UserOption is generic is really an implementation detail, not something to be used publicly. So by having an `AnyOptionType` alias, we can get better type checking, as can be seen by the patch as a whole. One of the big fixes it replace open-coded equivlalents of `MutableKeydOptionDictType` with that type alias.
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/compilers.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 5777f19f1..0f7ef172f 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -35,7 +35,6 @@ if T.TYPE_CHECKING:
from ..dependencies import Dependency
CompilerType = T.TypeVar('CompilerType', bound='Compiler')
- UserOptionType = T.TypeVar('UserOptionType', bound=options.UserOption)
_T = T.TypeVar('_T')
@@ -592,7 +591,7 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
return f'{self.language}_{key.name}'
@staticmethod
- def update_options(options: MutableKeyedOptionDictType, *args: T.Tuple[OptionKey, UserOptionType]) -> MutableKeyedOptionDictType:
+ def update_options(options: MutableKeyedOptionDictType, *args: T.Tuple[OptionKey, options.AnyOptionType]) -> MutableKeyedOptionDictType:
options.update(args)
return options