Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attr_* signatures are not being extracted with tapioca gem with hand rolled types #2020

Closed
ryanong opened this issue Sep 13, 2024 · 1 comment

Comments

@ryanong
Copy link

ryanong commented Sep 13, 2024

POC

# Gemfile

source 'https://rubygems.org'

gem 'sorbet', :group => :development
gem 'sorbet-runtime'
gem 'tapioca', require: false, :group => [:development, :test]
gem 'pdf-reader'
$ tapioca init
$ tapioca gem pdf-reader

If you look in the extracted rbi file for pdf-reader you will see that none of the attr_reader methods have signatures

This might apply to all gems including ones with inline types

@amomchilov
Copy link
Contributor

Hey Ryan! Your observations are exactly correct, and match this existing issue: #1918

I have some work-in-progress in #1936 which standardizes on always emitting attr_* methods as plain methods, so their types can be merged along with other plain methods like normal. I'm not sure when I'll be able to merge that, however.

For now, the temporary workaround is to write the gems' inline types using regular method syntax, instead of attr_*.

@amomchilov amomchilov closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants