Should the manual discuss type parameters of keyword arguments?

Type parameters for keyword arguments are currently

  1. a convenience form, equivalent to saving the result of a typeof,
  2. 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?

4 Likes

Yes.

2 Likes