summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Partin <tristan@partin.io>2023-08-10 10:53:09 -0500
committerEli Schwartz <eschwartz93@gmail.com>2023-10-04 15:16:58 -0400
commit88b337b77c264d3f39744b3b3bea8a29778a73c4 (patch)
treeb702d1c528438cc3907fb944dffaee3f19e69f75
parent87993b8210bf923d7120c7442fe987cdb04e6b12 (diff)
downloadmeson-88b337b77c264d3f39744b3b3bea8a29778a73c4.tar.gz
Remove unused code in interpreterbase
-rw-r--r--mesonbuild/interpreterbase/__init__.py8
-rw-r--r--mesonbuild/interpreterbase/baseobjects.py3
-rw-r--r--mesonbuild/interpreterbase/decorators.py16
3 files changed, 0 insertions, 27 deletions
diff --git a/mesonbuild/interpreterbase/__init__.py b/mesonbuild/interpreterbase/__init__.py
index 3cb95303f..8a2e0788f 100644
--- a/mesonbuild/interpreterbase/__init__.py
+++ b/mesonbuild/interpreterbase/__init__.py
@@ -46,7 +46,6 @@ __all__ = [
'disablerIfNotFound',
'permittedKwargs',
'typed_operator',
- 'unary_operator',
'typed_pos_args',
'ContainerTypeInfo',
'KwargInfo',
@@ -62,9 +61,6 @@ __all__ = [
'SubProject',
- 'TV_fw_var',
- 'TV_fw_args',
- 'TV_fw_kwargs',
'TV_func',
'TYPE_elementary',
'TYPE_var',
@@ -85,9 +81,6 @@ from .baseobjects import (
MutableInterpreterObject,
ContextManagerObject,
- TV_fw_var,
- TV_fw_args,
- TV_fw_kwargs,
TV_func,
TYPE_elementary,
TYPE_var,
@@ -115,7 +108,6 @@ from .decorators import (
ContainerTypeInfo,
KwargInfo,
typed_operator,
- unary_operator,
typed_kwargs,
FeatureCheckBase,
FeatureNew,
diff --git a/mesonbuild/interpreterbase/baseobjects.py b/mesonbuild/interpreterbase/baseobjects.py
index 4966978a0..38b181e27 100644
--- a/mesonbuild/interpreterbase/baseobjects.py
+++ b/mesonbuild/interpreterbase/baseobjects.py
@@ -35,9 +35,6 @@ if T.TYPE_CHECKING:
class OperatorCall(Protocol[__T]):
def __call__(self, other: __T) -> 'TYPE_var': ...
-TV_fw_var = T.Union[str, int, bool, list, dict, 'InterpreterObject']
-TV_fw_args = T.List[T.Union[mparser.BaseNode, TV_fw_var]]
-TV_fw_kwargs = T.Dict[str, T.Union[mparser.BaseNode, TV_fw_var]]
TV_func = T.TypeVar('TV_func', bound=T.Callable[..., T.Any])
diff --git a/mesonbuild/interpreterbase/decorators.py b/mesonbuild/interpreterbase/decorators.py
index 5bb8306a5..17c6c8c8f 100644
--- a/mesonbuild/interpreterbase/decorators.py
+++ b/mesonbuild/interpreterbase/decorators.py
@@ -142,22 +142,6 @@ def typed_operator(operator: MesonOperator,
return T.cast('_TV_FN_Operator', wrapper)
return inner
-def unary_operator(operator: MesonOperator) -> T.Callable[['_TV_FN_Operator'], '_TV_FN_Operator']:
- """Decorator that does type checking for unary operator calls.
-
- This decorator is for unary operators that do not take any other objects.
- It should be impossible for a user to accidentally break this. Triggering
- this check always indicates a bug in the Meson interpreter.
- """
- def inner(f: '_TV_FN_Operator') -> '_TV_FN_Operator':
- @wraps(f)
- def wrapper(self: 'InterpreterObject', other: TYPE_var) -> TYPE_var:
- if other is not None:
- raise mesonlib.MesonBugException(f'The unary operator `{operator.value}` of {self.display_name()} was passed the object {other} of type {type(other).__name__}')
- return f(self, other)
- return T.cast('_TV_FN_Operator', wrapper)
- return inner
-
def typed_pos_args(name: str, *types: T.Union[T.Type, T.Tuple[T.Type, ...]],
varargs: T.Optional[T.Union[T.Type, T.Tuple[T.Type, ...]]] = None,