Summary
src/model_macro.jl:959-961: keyword arguments in a @model function signature are parsed
and then ignored, with only a warning:
if !isnothing(ms_kwargs) && length(ms_kwargs) > 0
@warn("Model specification language does not support keyword arguments. Ignoring $(length(ms_kwargs)) keyword arguments.")
end
Suggestion
A user writing @model function m(x; a=1) gets no a in the body; a later UndefVarError
is the only signal, and the @warn is easy to miss. Since unsupported positional
arguments already hard-error (model_macro.jl:923), consider promoting the kwarg case to an
error for consistency and earlier failure. Deliberate design choice — flagging for
discussion rather than a hard bug.
Summary
src/model_macro.jl:959-961: keyword arguments in a@modelfunction signature are parsedand then ignored, with only a warning:
Suggestion
A user writing
@model function m(x; a=1)gets noain the body; a laterUndefVarErroris the only signal, and the
@warnis easy to miss. Since unsupported positionalarguments already hard-error (
model_macro.jl:923), consider promoting the kwarg case to anerrorfor consistency and earlier failure. Deliberate design choice — flagging fordiscussion rather than a hard bug.