luckyframework / luckyframework/avram
Possible issue with subclassing SaveOperations that have `needs`
Nobody has claimed this yet.
- Dominant language
- Crystal
- Stars
- 183
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Working on another PR, so this will need to be investigated. It seems like if you have an SaveOperation that has `needs`, and you subclass that, it will duplicate the instance variable in the constructor causing a compile-time `Error: duplicated argument name: ...` error...
```crystal
class SavePost < Post::SaveOperation
needs rollback : Bool = false
# ...
end
class SubSavePost < SavePost
end
# Error: duplicated argument name: rollback
```
Contributor guide
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
Start by reproducing the shown Crystal example with a SaveOperation that declares needs and a subclass of it. Trace how the needs declaration is turned into constructor arguments and verify the subclass no longer produces the duplicated rollback argument while preserving inherited behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- crystal
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100