I want to define a keyword argument that depends on the type of another keyword argument. For example,
function testf(c; a::A = 0.0, b::NTuple{2, Type{A}} = (A, A)) where A end
This is not possible, though:
julia> testf(0.0)
ERROR: UndefVarError: A not defined
Is there anyway to get around this? Even defining all the keyword arguments fails:
testf(0.0; a=0.0, b=(Float64, Float64))
julia> testf(0.0;a=0.0,b=(Float64,Float64))
ERROR: MethodError: no method matching var"#testf#97"(::Float64, ::Tuple{DataType, DataType}, ::typeof(testf), ::Float64)
Closest candidates are:
var"#testf#97"(::A, ::Tuple{Type{A}, Type{A}}, ::typeof(testf), ::Any) where A