ClojureScript

Externs inference on Number properties

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    {:deps {org.clojure/clojurescript {:mvn/version "1.10.339"}}}

Description

Observe the warning triggered here:

$ clj -m cljs.main -co '{:infer-externs true}' -r
ClojureScript 1.10.339
cljs.user=> (defn foo? [x y] (< x (or y (.-MAX_VALUE js/Number))))
WARNING: cljs.core/<, all arguments must be numbers, got [nil #{nil js/Number}] instead at line 1 <cljs repl>

This warning doesn't appear if you don't enable :infer-externs (in which case (.-MAX_VALUE js/Number) inferred to be of type js).

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: