lib/rbs/diff.rb in rbs-3.3.0 vs lib/rbs/diff.rb in rbs-3.3.1
- old
+ new
@@ -51,25 +51,25 @@
instance_methods = begin
builder.build_instance(@type_name).methods
rescue => e
RBS.logger.warn("#{path}: (#{e.class}) #{e.message}")
- {}
+ {} #: Hash[Symbol, Definition::Method]
end
singleton_methods = begin
builder.build_singleton(@type_name).methods
rescue => e
RBS.logger.warn("#{path}: (#{e.class}) #{e.message}")
- {}
+ {} #: Hash[Symbol, Definition::Method]
end
constant_children = begin
constant_resolver = RBS::Resolver::ConstantResolver.new(builder: builder)
constant_resolver.children(@type_name)
rescue => e
RBS.logger.warn("#{path}: (#{e.class}) #{e.message}")
- {}
+ {} #: Hash[Symbol, Constant]
end
[ instance_methods, singleton_methods, constant_children ]
end
@@ -99,10 +99,11 @@
def definition_method_to_s(key, kind, definition_method)
if definition_method
prefix = kind == :instance ? "" : "self."
if definition_method.alias_of
- "alias #{prefix}#{key} #{prefix}#{definition_method.alias_of.defs.first.member.name}"
+ first_def = definition_method.alias_of.defs.first #: Definition::Method::TypeDef
+ "alias #{prefix}#{key} #{prefix}#{first_def.member.name}"
else
"def #{prefix}#{key}: #{definition_method.method_types.join(" | ")}"
end
else
+"-"