tapioca icon indicating copy to clipboard operation
tapioca copied to clipboard

RBIs generated for a Struct should include `type_member` redefinitions

Open KaanOzkan opened this issue 3 years ago • 0 comments

For this piece of gem code:

class DescribeCertificateRequest < Struct.new(
    :certificate_arn)
    SENSITIVE = []
    include Aws::Structure
  end

We generate

# sorbet/rbi/gems/[email protected]
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.

KaanOzkan avatar Jul 25 '22 16:07 KaanOzkan