-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
When trying to pass kwargs with a valsplit the dispatched functions don't retain the kwargs
Here is a MWE
using ValSplit
@valsplit function soundof(Val(animal::Symbol); size::Number=10.0)
println(size)
error("Sound not defined for animal: \$animal")
end
function soundof(animal::Val{:dog}; size::Number=10.0)
if size > 20.0
return "Woof"
else
return "Arf"
end
end
function soundof(animal::Val{:cat}; size::Number=10.0)
return "Nyan"
end
soundof(:dog)
soundof(:cat)
soundof(:dog; size=30.0)
soundof(:lizard, size=100.0)
The valsplit argument is able to receive the kwarg but doesn't pass it onto the other functions. Is there a way to accomplish this?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels