Skip to content

FR: Allow UDFs to vary only in data annotations #1531

@nsiccha

Description

@nsiccha

Currently, defining the same function with the two signatures which are identical except for data annotations does not work (Stan will error during compilation with "Function '[...]' has already been declared for signature [...]`.

This is not usually a big issue, because the data annotations are optional and AFAIK don't provide a substantial benefit - except for allowing you to call other functions which only accept data arguments. Activity analysis (what's data, what's parameter) still happens AFAIK.

However, to work around #3224 , I now sometimes have to add data annotations, and I would like to just do it automatically (via code generation) whenever needed. However, this currently would lead to issues if the same function needs to get called with arguments that have different "activities". The data annotated function would of course not accept the parameter arguments, and defining the same function with more permissive data annotations is currently impossible.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions