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
When running type on a project that uses the latest sidekiq version, I will get this type error:
sorbet/rbi/gems/[email protected]:2965: Cannot initialize the module Worker by constant assignment https://srb.help/4022
2965 |Sidekiq::Worker = Sidekiq::Job
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sorbet/rbi/annotations/sidekiq.rbi:79: Previously defined as a module here
79 |module Sidekiq::Worker
^^^^^^^^^^^^^^^^^^^^^^
Note:
Sorbet does not allow treating constant assignments as class or module definitions,
even if the initializer computes a Module object at runtime. See the docs for more.
At first glance this doesn't seem to an issue of annotations, but changing all references of Sidekiq::Worker to Sidekiq::Job in sorbet/rbi/annotations/sidekiq.rbi fixes the issue.
Weirdly enough, when changing the references in a project that uses sidekiq < 7.0.0 also causes an error:
Method sidekiq_options does not exist on T.class_of(MyJob) https://srb.help/7003
Problem
When running type on a project that uses the latest sidekiq version, I will get this type error:
At first glance this doesn't seem to an issue of annotations, but changing all references of
Sidekiq::Worker
toSidekiq::Job
insorbet/rbi/annotations/sidekiq.rbi
fixes the issue.Weirdly enough, when changing the references in a project that uses sidekiq < 7.0.0 also causes an error:
Seems like a good use case for versioning
Context
I'm using
include Sidekiq::Job
in all my workers (in 6.0. and 7.0)Sidekiq aliases
Sidekiq::Job
toSidekiq::Worker
. Weirdly enough this has not been introduced in 7.0 and has been there before.0.10.2
0.5.10517
The text was updated successfully, but these errors were encountered: