interpreter: use typed_pos_args for install_data

pull/8884/head
Dylan Baker 3 years ago
parent 596c8d4af5
commit a551e76137
  1. 6
      mesonbuild/interpreter/interpreter.py
  2. 2
      test cases/failing/95 custom target install data/test.json

@ -1999,9 +1999,11 @@ This will become a hard error in the future.''' % kwargs['input'], location=self
@FeatureNewKwargs('install_data', '0.46.0', ['rename'])
@FeatureNewKwargs('install_data', '0.38.0', ['install_mode'])
@permittedKwargs({'install_dir', 'install_mode', 'rename', 'sources'})
def func_install_data(self, node, args: T.List, kwargs: T.Dict[str, T.Any]):
@typed_pos_args('install_data', varargs=(str, mesonlib.File))
def func_install_data(self, node: mparser.BaseNode, args: T.Tuple[T.List['mesonlib.FileOrString']],
kwargs: T.Dict[str, T.Any]):
kwsource = mesonlib.stringlistify(kwargs.get('sources', []))
raw_sources = args + kwsource
raw_sources = args[0] + kwsource
sources: T.List[mesonlib.File] = []
source_strings: T.List[str] = []
for s in raw_sources:

@ -1,7 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/95 custom target install data/meson.build:11:0: ERROR: Argument must be string or file."
"line": "test cases/failing/95 custom target install data/meson.build:11:0: ERROR: install_data argument 1 was of type \"CustomTarget\" but should have been one of: \"str\", \"File\""
}
]
}

Loading…
Cancel
Save