Skip to content

Commit

Permalink
Fix FrozenErrors
Browse files Browse the repository at this point in the history
  • Loading branch information
pocke committed Aug 29, 2022
1 parent 4015409 commit d03ab77
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/rbs/annotate/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Formatter
attr_reader :buffer

def initialize()
@buffer = ""
@buffer = +""
@pending_separator = nil
end

Expand All @@ -16,7 +16,7 @@ def <<(s)
s = self.class.translate(s) or raise
end

s.rstrip!
s = s.rstrip

unless s.empty?
if ss = @pending_separator
Expand Down
2 changes: 1 addition & 1 deletion lib/rbs/ast/type_param.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def self.rename(params, new_names:)
end

def to_s
s = ""
s = +""

if unchecked?
s << "unchecked "
Expand Down
2 changes: 1 addition & 1 deletion lib/rbs/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def initialize(type:, method_name:, members:)
@method_name = method_name
@members = members

message = "#{Location.to_string location}: #{qualified_method_name} has duplicated definitions"
message = +"#{Location.to_string location}: #{qualified_method_name} has duplicated definitions"
if members.size > 1
message << " in #{other_locations.map { |loc| Location.to_string loc }.join(', ')}"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rbs/writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def write_def(member)
"self.#{method_name(member.name)}"
end

string = ""
string = +""

prefix = "#{visibility}def #{name}:"
padding = " " * (prefix.size-1)
Expand Down

0 comments on commit d03ab77

Please sign in to comment.