Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion lib/ruby/signature/constant_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def constant_scopes_module(name, scopes:)
decl.members.each do |member|
case member
when AST::Members::Include
constant_scopes_module absolute_type_name(name, namespace: namespace),
constant_scopes_module absolute_type_name(member.name, namespace: namespace),
Copy link
Member

Choose a reason for hiding this comment

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

🙇

scopes: scopes
end
end
Expand Down
11 changes: 11 additions & 0 deletions test/ruby/signature/constant_table_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,12 @@ def test_reference_constant_inherit_module
class Set
end

module Baz
end
Baz::X: Integer

module Foo::Bar
include Baz
end
EOF
manager.build do |env|
Expand All @@ -139,6 +144,12 @@ module Foo::Bar
assert_equal "::Set", constant.name.to_s
assert_equal 'singleton(::Set)', constant.type.to_s
end

table.resolve_constant_reference(TypeName.new(name: :X, namespace: Namespace.empty), context: Namespace.parse("::Foo::Bar")).tap do |constant|
assert_instance_of Constant, constant
assert_equal "::Baz::X", constant.name.to_s
assert_equal '::Integer', constant.type.to_s
end
end
end
end
Expand Down