Skip to content
Snippets Groups Projects
Commit 7eadf32a authored by Jonathan Chang's avatar Jonathan Chang
Browse files

Fix type signature of StringInreplaceExtension

parent b0cd9dba
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ class StringInreplaceExtension
# Same as `String#sub!`, but warns if nothing was replaced.
#
# @api public
sig { params(before: String, after: String).returns(T.nilable(String)) }
sig { params(before: T.any(Regexp, String), after: String).returns(T.nilable(String)) }
def sub!(before, after)
result = inreplace_string.sub!(before, after)
errors << "expected replacement of #{before.inspect} with #{after.inspect}" unless result
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment