Version
basilisk 0.35.0 (also present on 0.39.0).
What happens
Passing the literal None to a parameter declared dict[str, Any] | None is
reported as an error:
warning[calls_argument_type]: Argument `body` of `_probe` expects `dict[str, Any] | None`
but received a scalar literal where `dict[str, Any] | None` is required
— no type-variable assignment makes it valid
Minimal reproduction
from typing import Any
def probe(body: dict[str, Any] | None) -> None: ...
probe(None) # warning[calls_argument_type]
Expected
No diagnostic. None is a member of dict[str, Any] | None by definition, so
the call is well-typed.
Notes
The message calls None "a scalar literal", which suggests the argument check
is comparing the literal against the dict[str, Any] member of the union only
and never trying the None member. A non-literal None-typed variable is
accepted at the same call site, so it looks specific to the literal path.
Version
basilisk 0.35.0(also present on 0.39.0).What happens
Passing the literal
Noneto a parameter declareddict[str, Any] | Noneisreported as an error:
Minimal reproduction
Expected
No diagnostic.
Noneis a member ofdict[str, Any] | Noneby definition, sothe call is well-typed.
Notes
The message calls
None"a scalar literal", which suggests the argument checkis comparing the literal against the
dict[str, Any]member of the union onlyand never trying the
Nonemember. A non-literalNone-typed variable isaccepted at the same call site, so it looks specific to the literal path.