Skip to content
Draft
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
6 changes: 3 additions & 3 deletions lib/solargraph/complex_type/unique_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ def desc
rooted_tags
end

# @sg-ignore Need better if/elseanalysis
# @return [String]
def to_rbs
if duck_type?
Expand All @@ -311,8 +310,9 @@ def to_rbs
'bool'
elsif name.downcase == 'nil'
'nil'
elsif name == GENERIC_TAG_NAME
all_params.first&.name
elsif name == GENERIC_TAG_NAME && !all_params.empty?
# @sg-ignore flow sensitive typing should be able to handle !empty? narrowing first to non-nil
all_params.first.name
elsif %w[Class Module].include?(name)
rbs_name
elsif %w[Tuple Array].include?(name) && fixed_parameters?
Expand Down
Loading