diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-10-10 07:31:49 -0400 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2021-10-10 16:59:18 +0200 |
commit | ba432c87a4fefcb784b9b23ac691e870735c044f (patch) | |
tree | 8be945bbef078100137d1cc4e63683c48b80d33a /mesonbuild/interpreter | |
parent | 4d9cc9ceabdbc0c77ecb11f71904c5e71bd264dc (diff) | |
download | meson-ba432c87a4fefcb784b9b23ac691e870735c044f.zip meson-ba432c87a4fefcb784b9b23ac691e870735c044f.tar.gz meson-ba432c87a4fefcb784b9b23ac691e870735c044f.tar.bz2 |
Revert "interpreter: Add FeatureNew check"
This reverts commit c0efa7ab22f8900f6fa1dadf0d306ec375569c8d.
This was a nice idea, or a beautiful hack depending on your perspective.
Unfortunately, it turns out to be a lot harder than we originally
thought. By operating on bare nodes, we end up triggering a FeatureNew
on anything that isn't a string literal, rather than anything that
isn't a string.
Since no one else has come up with a better idea for implementing a
FeatureNew, let's just revert it. Better to not have a warning, than
have it trigger way too often.
Diffstat (limited to 'mesonbuild/interpreter')
-rw-r--r-- | mesonbuild/interpreter/primitives/string.py | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/mesonbuild/interpreter/primitives/string.py b/mesonbuild/interpreter/primitives/string.py index aad28af..5b29501 100644 --- a/mesonbuild/interpreter/primitives/string.py +++ b/mesonbuild/interpreter/primitives/string.py @@ -21,11 +21,6 @@ from ...interpreterbase import ( InvalidArguments, ) -from ...mparser import ( - MethodNode, - StringNode, - ArrayNode, -) if T.TYPE_CHECKING: @@ -109,13 +104,6 @@ class StringHolder(ObjectHolder[str]): @noKwargs @typed_pos_args('str.join', varargs=str) def join_method(self, args: T.Tuple[T.List[str]], kwargs: TYPE_kwargs) -> str: - # Implement some basic FeatureNew check on the AST level - assert isinstance(self.current_node, MethodNode) - n_args = self.current_node.args.arguments - if len(n_args) != 1 or not isinstance(n_args[0], ArrayNode) or not all(isinstance(x, StringNode) for x in n_args[0].args.arguments): - FeatureNew.single_use('str.join (varargs)', '0.60.0', self.subproject, 'List-flattening and variadic arguments') - - # Actual implementation return self.held_object.join(args[0]) @noKwargs |