You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tapioca gem generates RBI methods for verify? but not for verify_hostname/verify_hostname=. The Ruby docs recommend the block form to define a struct, which avoids creating an unused anonymous class in the ancestor chain:
which also happens to help Tapioca pick the verify_hostname/verify_hostname= methods.
It seems in #464 the intent was to fix this, but it seems to have been abandoned. IDK if this is still the plan or that people should just use the Style/StructInheritance Rubocop to avoid the issue from occurring?
The text was updated successfully, but these errors were encountered:
Looks like we return early here because the method's owner is not the constant (SSLOptions) but an anonymous class.
@paracycle can we use something else other than method.owner to get this information. Maybe special case struct definitions and do constant.instance_methods.include?(method.name)?
Any special handling should also take care of the Ruby 3.2+ Data class. It has the same problem and like for Struct, there's also a Rubocop for it: rubocop/rubocop#11728
Pulling this out of the Sorbet Slack space and putting it here in case people are surprised by this and can find something about it.
I noticed this pattern in Faraday (ref lostisland/faraday#1489 and lostisland/faraday#1491):
tapioca gem
generates RBI methods forverify?
but not forverify_hostname
/verify_hostname=
. The Ruby docs recommend the block form to define a struct, which avoids creating an unused anonymous class in the ancestor chain:which also happens to help Tapioca pick the
verify_hostname
/verify_hostname=
methods.It seems in #464 the intent was to fix this, but it seems to have been abandoned. IDK if this is still the plan or that people should just use the
Style/StructInheritance
Rubocop to avoid the issue from occurring?The text was updated successfully, but these errors were encountered: