diff --git a/mesonbuild/interpreter/kwargs.py b/mesonbuild/interpreter/kwargs.py index f2460ac294a9..bb56ff23b640 100644 --- a/mesonbuild/interpreter/kwargs.py +++ b/mesonbuild/interpreter/kwargs.py @@ -183,7 +183,7 @@ class CustomTarget(TypedDict): input: T.List[T.Union[str, build.BuildTarget, build.CustomTarget, build.CustomTargetIndex, build.ExtractedObjects, build.GeneratedList, ExternalProgram, File]] install: bool - install_dir: T.List[T.Union[str, bool]] + install_dir: T.List[T.Union[str, T.Literal[False]]] install_mode: FileMode install_tag: T.List[T.Optional[str]] output: T.List[str] diff --git a/mesonbuild/interpreter/type_checking.py b/mesonbuild/interpreter/type_checking.py index 328f032516c4..ee6eef5047ed 100644 --- a/mesonbuild/interpreter/type_checking.py +++ b/mesonbuild/interpreter/type_checking.py @@ -297,11 +297,12 @@ def _output_validator(outputs: T.List[str]) -> T.Optional[str]: INSTALL_KW = KwargInfo('install', bool, default=False) -CT_INSTALL_DIR_KW: KwargInfo[T.List[T.Union[str, bool]]] = KwargInfo( +CT_INSTALL_DIR_KW: KwargInfo[T.List[T.Union[str, Literal[False]]]] = KwargInfo( 'install_dir', ContainerTypeInfo(list, (str, bool)), listify=True, default=[], + validator=lambda x: 'must be `false` if boolean' if True in x else None, ) CT_BUILD_BY_DEFAULT: KwargInfo[T.Optional[bool]] = KwargInfo('build_by_default', (bool, type(None)), since='0.40.0')