Skip to content

Consider promoting @model keyword-argument drop from @warn to @error #307

Description

@docxology

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions