summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/clj/clojure/string.clj5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/clj/clojure/string.clj b/src/clj/clojure/string.clj
index 76ac2d6d..dc061631 100644
--- a/src/clj/clojure/string.clj
+++ b/src/clj/clojure/string.clj
@@ -64,8 +64,9 @@ clojure.string adheres to the following design principles:
(cond
(instance? Character match) (.replace s ^Character match ^Character replacement)
(instance? CharSequence match) (.replace s ^CharSequence match ^CharSequence replacement)
- (instance? Pattern match) (if (string? replacement)
- (.replaceAll (re-matcher ^Pattern match s) ^CharSequence replacement)
+ (instance? Pattern match) (if (instance? CharSequence replacement)
+ (.replaceAll (re-matcher ^Pattern match s)
+ (.toString replacement))
(replace-by s match replacement))
:else (throw (IllegalArgumentException. (str "Invalid match arg: " match))))))