RBIs generated for a Struct should include `type_member` redefinitions
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 873
- Forks
- 164
- Avg merge
- 4d 27m
- Merged PRs (30d)
- 9
Description
For this piece of gem code:
class DescribeCertificateRequest < Struct.new(
:certificate_arn)
SENSITIVE = []
include Aws::Structure
end
We generate
# sorbet/rbi/gems/aws-sdk-acm@1.51.0.rbi
class Aws::ACM::Types::DescribeCertificateRequest < ::Struct
include ::Aws::Structure
end
Which results in a Type Elem declared by parent Struct must be re-declared in Aws::ACM::Types::DescribeCertificateResponse error when redefining the class for an annotation:
# rbi/annotations/aws-sdk-acm.rbi
class Aws::ACM::Types::DescribeCertificateResponse
include ::Aws::Structure
sig { returns(Aws::ACM::Types::CertificateDetail) }
def certificate; end
end
https://github.com/Shopify/rbi-central/runs/7503701436?check_suite_focus=true#step:4:39
Given annotations are a part of Tapioca and the bad user experience I think this can be Tapioca's responsibility instead of cluttering the annotations with type declarations.
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
Start by reproducing the Struct example from gems/aws-sdk-acm/lib/aws-sdk-acm/types.rb and inspect the generated sorbet/rbi/gems/aws-sdk-acm@1.51.0.rbi alongside rbi/annotations/aws-sdk-acm.rbi. Trace the RBI generation path for Struct subclasses and verify that the generated RBI declares the needed type members so the annotation no longer produces the Sorbet error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100