lib/rbs/definition_builder.rb in rbs-3.1.1 vs lib/rbs/definition_builder.rb in rbs-3.1.2

- old
+ new

@@ -751,16 +751,18 @@ def expand_alias(type_name) expand_alias2(type_name, []) end def expand_alias1(type_name) + type_name = env.normalize_type_name(type_name) entry = env.type_alias_decls[type_name] or raise "Unknown alias name: #{type_name}" as = entry.decl.type_params.each.map { Types::Bases::Any.new(location: nil) } expand_alias2(type_name, as) end def expand_alias2(type_name, args) + type_name = env.normalize_type_name(type_name) entry = env.type_alias_decls[type_name] or raise "Unknown alias name: #{type_name}" ensure_namespace!(type_name.namespace, location: entry.decl.location) params = entry.decl.type_params.each.map(&:name) @@ -809,12 +811,11 @@ validate_type_presence(type) end end def validate_type_name(name, location) - name = name.absolute! - - return if env.type_name?(name) + name = name.absolute! unless name.absolute? + return if env.type_name?(env.normalize_type_name(name)) raise NoTypeFoundError.new(type_name: name, location: location) end end end