Type parameters for keyword arguments are currently
- a convenience form, equivalent to saving the result of a
typeof
, - perform a subtype check when that is specified.
Eg
foo(; a::C) where {C <: Integer} = :C
is more or less equivalent to
function foo(; a)
C = typeof(a)
@assert C <: Integer # it is a MethodError, but you get the idea
:C
end
Notably, they do not participate in dispatch, but the above features are undocumented.
Should we address them in the docs?