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

Bump the minor-and-patch group with 4 updates #1948

Merged
merged 4 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ GEM
hashdiff (1.1.0)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
identity_cache (1.5.6)
identity_cache (1.6.0)
activerecord (>= 7.0)
ar_transaction_changes (~> 1.1)
io-console (0.7.2)
irb (1.13.2)
irb (1.14.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.7.2)
Expand Down Expand Up @@ -278,7 +278,7 @@ GEM
regexp_parser (2.9.2)
reline (0.5.9)
io-console (~> 0.5)
rexml (3.3.0)
rexml (3.3.1)
strscan
rubocop (1.64.1)
json (~> 2.3)
Expand All @@ -293,7 +293,7 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
rubocop-rspec (3.0.1)
rubocop-rspec (3.0.2)
rubocop (~> 1.61)
rubocop-shopify (2.15.1)
rubocop (~> 1.51)
Expand All @@ -308,14 +308,14 @@ GEM
rack (>= 2.2.4)
redis-client (>= 0.22.2)
smart_properties (1.17.0)
sorbet (0.5.11463)
sorbet-static (= 0.5.11463)
sorbet-runtime (0.5.11463)
sorbet-static (0.5.11463-universal-darwin)
sorbet-static (0.5.11463-x86_64-linux)
sorbet-static-and-runtime (0.5.11463)
sorbet (= 0.5.11463)
sorbet-runtime (= 0.5.11463)
sorbet (0.5.11473)
sorbet-static (= 0.5.11473)
sorbet-runtime (0.5.11473)
sorbet-static (0.5.11473-universal-darwin)
sorbet-static (0.5.11473-x86_64-linux)
sorbet-static-and-runtime (0.5.11473)
sorbet (= 0.5.11473)
sorbet-runtime (= 0.5.11473)
spoom (1.3.2)
erubi (>= 1.10.0)
prism (>= 0.19.0)
Expand Down
4 changes: 2 additions & 2 deletions lib/tapioca/dsl/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ def processable_constants
sig { returns(T::Enumerable[T::Class[T.anything]]) }
def all_classes
@all_classes ||= T.let(
T.cast(ObjectSpace.each_object(Class), T::Enumerable[T::Class[T.anything]]).each,
ObjectSpace.each_object(Class).each,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to the change, but does this .each even do anything? ObjectSpace.each_object(Class) is already an T::Enumerable[T::Class[T.anything]]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, seems unnecessary:

irb(main):002> ObjectSpace.each_object(Module).count
=> 773
irb(main):003> ObjectSpace.each_object(Module).each.count
=> 773

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: the result is an enumerator not an enumerable, when no block is given.

T.nilable(T::Enumerable[T::Class[T.anything]]),
)
end

sig { returns(T::Enumerable[Module]) }
def all_modules
@all_modules ||= T.let(
T.cast(ObjectSpace.each_object(Module), T::Enumerable[Module]).each,
ObjectSpace.each_object(Module).each,
T.nilable(T::Enumerable[Module]),
)
end
Expand Down
4 changes: 1 addition & 3 deletions lib/tapioca/dsl/compilers/protobuf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ class << self
def gather_constants
marker = Google::Protobuf::MessageExts::ClassMethods

enum_modules = ObjectSpace.each_object(Google::Protobuf::EnumDescriptor).map do |desc|
T.cast(desc, Google::Protobuf::EnumDescriptor).enummodule
end
enum_modules = ObjectSpace.each_object(Google::Protobuf::EnumDescriptor).map(&:enummodule)

results = if Google::Protobuf.const_defined?(:AbstractMessage)
abstract_message_const = ::Google::Protobuf.const_get(:AbstractMessage)
Expand Down
2 changes: 1 addition & 1 deletion lib/tapioca/runtime/reflection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def method_of(constant, method)
end
def descendants_of(klass)
result = ObjectSpace.each_object(klass.singleton_class).reject do |k|
T.cast(k, Module).singleton_class? || T.unsafe(k) == klass
k.singleton_class? || T.unsafe(k) == klass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can remove the unsafe if we flip this and make the receiver be the klass:

Suggested change
k.singleton_class? || T.unsafe(k) == klass
k.singleton_class? || klass == k

end

T.unsafe(result)
Expand Down
Loading