lib/rbs/definition_builder/ancestor_builder.rb in rbs-2.2.2 vs lib/rbs/definition_builder/ancestor_builder.rb in rbs-2.3.0

- old
+ new

@@ -365,11 +365,11 @@ entry.decls.each do |d| decl = d.decl align_params = Substitution.build( decl.type_params.each.map(&:name), - Types::Variable.build(entry.type_params.each.map(&:name)) + entry.type_params.map {|param| Types::Variable.new(name: param.name, location: param.location) } ) mixin_ancestors0(decl, type_name, align_params: align_params, @@ -384,10 +384,12 @@ def instance_ancestors(type_name, building_ancestors: []) as = instance_ancestors_cache[type_name] and return as entry = env.class_decls[type_name] or raise "Unknown name for instance_ancestors: #{type_name}" params = entry.type_params.each.map(&:name) - args = Types::Variable.build(params) + args = entry.type_params.map do |type_param| + Types::Variable.new(name: type_param.name, location: type_param.location) + end self_ancestor = Definition::Ancestor::Instance.new(name: type_name, args: args, source: nil) RecursiveAncestorError.check!(self_ancestor, ancestors: building_ancestors, location: entry.primary.decl.location)