Skip to content

Commit ef66637

Browse files
committed
support ^long and ^double type hints
1 parent c437042 commit ef66637

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/clj/cljs/analyzer.clj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,12 +1707,16 @@
17071707
(when-not (every?
17081708
(fn [t]
17091709
(or (nil? t)
1710-
(and (symbol? t) ('#{any number} t))
1710+
(and (symbol? t) ('#{any number long double} t))
17111711
;; TODO: type inference is not strong enough to detect that
17121712
;; when functions like first won't return nil, so variadic
17131713
;; numeric functions like cljs.core/< would produce a spurious
17141714
;; warning without this - David
1715-
(and (set? t) (or (contains? t 'number) (contains? t 'any)))))
1715+
(and (set? t)
1716+
(or (contains? t 'number)
1717+
(contains? t 'long)
1718+
(contains? t 'double)
1719+
(contains? t 'any)))))
17161720
types)
17171721
(warning :invalid-arithmetic env
17181722
{:js-op (-> form meta :js-op)

0 commit comments

Comments
 (0)