Skip to content

Commit

Permalink
Merge pull request #1502 from ruby/relative-type-names
Browse files Browse the repository at this point in the history
Make alias and interface names absolute
  • Loading branch information
soutaro authored Sep 5, 2023
2 parents ed748bf + 6828d42 commit fce99b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rbs/test/type_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def value(val, type)
val.is_a?(singleton_class)
when Types::Interface
methods = Set.new(Test.call(val, METHODS))
if (definition = builder.build_interface(type.name))
if (definition = builder.build_interface(type.name.absolute!))
definition.methods.each_key.all? do |method_name|
methods.member?(method_name)
end
Expand All @@ -318,7 +318,7 @@ def value(val, type)
when Types::Optional
Test.call(val, IS_AP, ::NilClass) || value(val, type.type)
when Types::Alias
value(val, builder.expand_alias2(type.name, type.args))
value(val, builder.expand_alias2(type.name.absolute!, type.args))
when Types::Tuple
Test.call(val, IS_AP, ::Array) &&
type.types.map.with_index {|ty, index| value(val[index], ty) }.all?
Expand Down

0 comments on commit fce99b9

Please sign in to comment.