Skip to content

Commit

Permalink
Solves warning about deprecation in Ruby 2.7
Browse files Browse the repository at this point in the history
"Using the last argument as keyword parameters is deprecated"

https://piechowski.io/post/last-arg-keyword-deprecated-ruby-2-7/
  • Loading branch information
kha-faz committed May 18, 2020
1 parent fc89b88 commit dd73df0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tco_method.rb
Expand Up @@ -27,7 +27,7 @@ module TCOMethod
# @raise [ArgumentError] if the provided code argument is not a String.
def self.tco_eval(code, file = nil, path = nil, line = nil)
raise ArgumentError, "Invalid code string!" unless code.is_a?(String)
RubyVM::InstructionSequence.new(code, file, path, line, ISEQ_OPTIONS).eval
RubyVM::InstructionSequence.new(code, file, path, line, **ISEQ_OPTIONS).eval
end

# Allows for executing a block of code with tail call optimization enabled.
Expand Down

0 comments on commit dd73df0

Please sign in to comment.