Fix type errors

This commit is contained in:
Douglas Eichelberger 2023-03-02 14:39:55 -08:00
parent e68b02c4a6
commit d8ba8c807a

View File

@ -32,11 +32,12 @@ class Array
when 0
+""
when 1
+(self[0]).to_s
# This is not typesafe, if the array contains a BasicObject
+T.unsafe(self[0]).to_s
when 2
+"#{self[0]}#{two_words_connector}#{self[1]}"
else
+"#{self[0...-1].join(words_connector)}#{last_word_connector}#{self[-1]}"
+"#{T.must(self[0...-1]).join(words_connector)}#{last_word_connector}#{self[-1]}"
end
end
end