Tapioca does not generate a signature for ActiveSupport's Time#rfc3339
#2082
Labels
help-wanted
We support this change, and welcome community contributions for it.
I've discussed this with @andyw8 on Slack.
I'm working on a Rails application that uses Sorbet and Tapioca.
Using
Time.now.rfc3339
in the app introduced a Sorbet error:Time#rfc3339
is defined in an ActiveSupport core extension:activesupport/core_ext/time/conversions
, as an alias toTime#xmlschema
, which itself is defined in Ruby'sTime
class (here).What's weird is that Tapioca appears to be able to pick up another method defined with
alias_method
in the sameactive_support/core_ext/time/conversions
file. (This one:to_formatted_s
.)In another experiment, I tried adding
def xmlschema; end
in that file,active_support/core_ext/time/conversions
, before the linealias_method :rfc3339, :xmlschema
. When I runbin/tapioca gem activesupport
, it adds the signatures for bothTime#xmlschema
andTime#rfc3339
tosorbet/rbi/gems/activesupport@8.0.0.rbi
.I tried adding either or both of the two lines below in the
sorbet/tapioca/require.rb
file, but it does not seem to change anything, unfortunately.Also note that Sorbet defines a signature for
Time#xmlschema
, here.Finally, I tried replacing
Time.now.rfc3339
withTime.now.xmlschema
in my code, and now the Sorbet error is gone, so I'll simply go with that for now.The text was updated successfully, but these errors were encountered: