This assert causes several type checkers (both mypy and pyright) to
force `obj` to be a base `HoldableObject` instead of the specialized
object. Since the check itself may still be valuable as we don't have
fully type annotation coverage it's simply been removed when type
checking to aid in type specialization.
Because of the convertor function we have no guarantee that what we're
getting is in fact a `Dict[str, TYPE_var]`, it might well be anything in
the values, so we need to do some casting and set the return type to
object. This works out fine in practice as our declared `TypeDict`
inputs in the actual function signatures will be used instead.
This commit introduces a new type of `HoldableObject`: The
`SecondLevelHolder`. The primary purpose of this class is
to handle cases where two (or more) `HoldableObject`s are
stored at the same time (with one default object). The
best (and currently only) example here is the `BothLibraries`
class.
As a side-effect from #8885 `find_program()` returns now `Executable`
objects when `meson.override_find_program` is called with an
executable target. To resolve this conflict the missing methods
from `ExternalProgram` are added to `BuildTarget`.
This allows checking specific values that are added or deprecated, which
we do a surprising amount of. This works with both containers and scalar
values