declare_dependency: fix regression in printing the correct error

In commit 47426f3663 we migrated to
typed_kwargs, but the validator accepted a list and checked to see if it
was a single Dependency object.

Fixes #10813
pull/10814/head
Eli Schwartz 2 years ago
parent 004575874f
commit 24ac3cdb9c
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 2
      mesonbuild/interpreter/type_checking.py

@ -409,7 +409,7 @@ LINK_WITH_KW: KwargInfo[T.List[T.Union[BothLibraries, SharedLibrary, StaticLibra
ContainerTypeInfo(list, (BothLibraries, SharedLibrary, StaticLibrary, CustomTarget, CustomTargetIndex, Jar, Executable, Dependency)),
listify=True,
default=[],
validator=lambda x: _link_with_error if isinstance(x, Dependency) else None,
validator=lambda x: _link_with_error if any(isinstance(i, Dependency) for i in x) else None,
)
def link_whole_validator(values: T.List[T.Union[StaticLibrary, CustomTarget, CustomTargetIndex, Dependency]]) -> T.Optional[str]:

Loading…
Cancel
Save