From 358972db53c126bb67e672dea50d0d83c6fc3bae Mon Sep 17 00:00:00 2001 From: rogancodes Date: Tue, 17 Dec 2024 17:36:42 +0530 Subject: [PATCH] changes as per review comment --- lib/ruby_indexer/lib/ruby_indexer/index.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ruby_indexer/lib/ruby_indexer/index.rb b/lib/ruby_indexer/lib/ruby_indexer/index.rb index d7225625f..fbfa578c8 100644 --- a/lib/ruby_indexer/lib/ruby_indexer/index.rb +++ b/lib/ruby_indexer/lib/ruby_indexer/index.rb @@ -586,8 +586,8 @@ def resolve_instance_variable(variable_name, owner_name) sig { params(variable_name: String, owner_name: String).returns(T.nilable(T::Array[Entry::ClassVariable])) } def resolve_class_variable(variable_name, owner_name) - entries = T.cast(self[variable_name], T.nilable(T::Array[Entry::ClassVariable])) - return unless entries + entries = self[variable_name]&.grep(Entry::ClassVariable) + return unless entries&.any? ancestors = linearized_ancestors_of(owner_name) return if ancestors.empty?