FR: Allow UDFs to vary only in `data` annotations
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 160
- Forks
- 59
- Avg merge
- 21h 45m
- Merged PRs (30d)
- 26
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points; begin by locating the compiler validation that rejects UDFs differing only in data annotations. Done means such overloads compile while calls with incompatible argument activities remain correctly rejected, with regression coverage for both cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100