Skip to content

Commit b9a51c4

Browse files
foguspuredanger
authored andcommitted
CLJ-2709: Check arguments to range to see if they are fixed-precision integers and if so upcast them to Long when creating the LongRange instance.
1 parent cdba5c8 commit b9a51c4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/clj/clojure/core.clj

+3-3
Original file line numberDiff line numberDiff line change
@@ -3045,15 +3045,15 @@
30453045
([]
30463046
(iterate inc' 0))
30473047
([end]
3048-
(if (instance? Long end)
3048+
(if (int? end)
30493049
(clojure.lang.LongRange/create end)
30503050
(clojure.lang.Range/create end)))
30513051
([start end]
3052-
(if (and (instance? Long start) (instance? Long end))
3052+
(if (and (int? start) (int? end))
30533053
(clojure.lang.LongRange/create start end)
30543054
(clojure.lang.Range/create start end)))
30553055
([start end step]
3056-
(if (and (instance? Long start) (instance? Long end) (instance? Long step))
3056+
(if (and (int? start) (int? end) (int? step))
30573057
(clojure.lang.LongRange/create start end step)
30583058
(clojure.lang.Range/create start end step))))
30593059

0 commit comments

Comments
 (0)