[Feature] `#unwrap_optional` helper
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 2.2k
- Forks
- 256
- Avg merge
- 6d 17h
- Merged PRs (30d)
- 37
Description
It's a really common operation to unwrap the optionality out of a type, e.g. turning String? into String.
I'd propose (in psuedocode):
interface RBS::Types::_TypeBase
# @overridable
#: -> _TypeBase
def unwrap_optional
self # not optional, nothing to unwrap.
end
end
class RBS::Types::Optional
# @override
#: -> _TypeBase
def unwrap_optional
type
end
end
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 locating RBS::Types::_TypeBase and RBS::Types::Optional, then read nearby type helpers and their tests if present. Add unwrap_optional so non-optional types return themselves while Optional returns its underlying type. Done means both behaviors are covered and the relevant test suite passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100