New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infer types #1

Open
wants to merge 2 commits into
from
Jump to file or symbol
Failed to load files and symbols.
+295 −5
Diff settings

Always

Just for now

@@ -35,6 +35,293 @@
java.io.File)
:cljs (:import [goog.string StringBuffer])))
;; Start: Generated by clojure.core.typed - DO NOT EDIT
(declare
ArglistsDocFileMap
ColumnLineNameMap
DefsMap
EnvExprFormMap
FnScopeFnSelfNameNsMap
FnVarMethodParamsNameMap
NameNsArglistsMap
StaticFnsMap
context
name-info__899853
op)
(t/defalias
ArglistsDocFileMap
'{:arglists (t/Coll t/Any), :doc t/Str, :file nil})
(t/defalias
ColumnLineNameMap
(t/HMap
:mandatory
{:column t/Int, :line t/Int, :name t/Sym}
:optional
{:op ':var,
:arglists ?,
:arglists-meta ?,
:binding-form? Boolean,
:doc ?,
:env context,
:file nil,
:fn-var Boolean,
:info name-info__899853,
:max-fixed-arity t/Int,
:meta ArglistsDocFileMap,
:method-params (t/Coll (t/Vec t/Nothing)),
:ns ?,
:protocol-impl nil,
:protocol-inline nil,
:shadow nil,
:tag nil,
:variadic ?}))
(t/defalias DefsMap '{:defs (t/Map t/Sym FnVarMethodParamsNameMap)})
(t/defalias
EnvExprFormMap
'{:env context,
:expr op,
:form ?,
:max-fixed-arity ?,
:name ?,
:params (t/Vec t/Nothing),
:recurs nil,
:type nil,
:variadic false})
(t/defalias
FnScopeFnSelfNameNsMap
'{:fn-scope (t/Vec name-info__899853),
:fn-self-name Boolean,
:ns t/Sym,
:shadow (t/U nil name-info__899853)})
(t/defalias
FnVarMethodParamsNameMap
'{:fn-var Boolean,
:method-params (t/Coll '[t/Sym]),
:name t/Sym,
:ns t/Sym,
:protocol t/Sym})
(t/defalias
NameNsArglistsMap
(t/HMap
:mandatory
{:name t/Sym, :ns t/Sym}
:optional
{:arglists (t/Coll t/Any),
:arglists-meta (t/Coll nil),
:column t/Int,
:doc t/Str,
:file nil,
:fn-var Boolean,
:line t/Int,
:max-fixed-arity t/Int,
:meta ArglistsDocFileMap,
:method-params (t/Coll (t/Vec t/Sym)),
:protocol t/Sym,
:protocol-impl nil,
:protocol-inline nil,
:tag t/Sym,
:variadic false}))
(t/defalias StaticFnsMap '{:static-fns Boolean})
(t/defalias
context
(t/U
(t/HMap
:mandatory
{:context ':expr}
:optional
{:column t/Int,
:fn-scope (t/Vec name-info__899853),
:js-globals (t/Map t/Sym name-info__899853),
:line t/Int,
:locals (t/Map t/Nothing t/Nothing),
:ns name-info__899853,
:protocol-impl nil,
:protocol-inline nil,
::ana/namespaces (t/Map t/Sym DefsMap)})
'{:context ':return,
:column t/Int,
:fn-scope '[name-info__899853],
:js-globals (t/Map t/Sym name-info__899853),
:line t/Int,
:locals (t/Map t/Nothing t/Nothing),
:ns name-info__899853,
:protocol-impl nil,
:protocol-inline nil}
'{:context ':statement,
:column t/Int,
:fn-scope (t/Vec t/Nothing),
:js-globals (t/Map t/Sym name-info__899853),
:line t/Int,
:locals (t/Map t/Nothing t/Nothing),
:ns name-info__899853}))
(t/defalias
name-info__899853
(t/U
NameNsArglistsMap
(t/HMap
:mandatory
{:name t/Sym}
:optional
{:info FnScopeFnSelfNameNsMap, :shadow nil})))
(t/defalias
op
(t/U
'{:op ':constant, :env context, :form (t/U nil t/Int), :tag t/Sym}
'{:op ':def,
:children '[op],
:doc ?,
:env ?,
:form ?,
:init ?,
:jsdoc nil,
:name ?,
:tag ?,
:var ?}
'{:op ':do,
:children '[op],
:env ?,
:form ?,
:ret op,
:statements nil,
:tag ?}
'{:op ':fn,
:children '[op],
:env ?,
:form ?,
:jsdoc ?,
:loop-lets ?,
:max-fixed-arity ?,
:methods ?,
:name ?,
:protocol-impl nil,
:protocol-inline nil,
:recur-frames ?,
:tag ?,
:variadic false}
'{:op ':js,
:args '[op op],
:children '[op op],
:env context,
:form (t/Coll (t/U t/Str t/Int t/Sym)),
:js-op t/Sym,
:numeric Boolean,
:segs (t/Coll t/Str),
:tag t/Sym}
(t/HMap
:mandatory
{:op ':var,
:env context,
:info (t/U name-info__899853 NameNsArglistsMap),
:tag (t/U nil t/Sym)}
:optional
{:binding-form? Boolean,
:column t/Int,
:form t/Sym,
:line t/Int,
:name t/Sym,
:shadow nil})))
(t/ann cljs.analyzer/*cljs-static-fns* Boolean)
(t/ann cljs.analyzer/*load-tests* Boolean)
(t/ann cljs.analyzer/analyze-file [t/Str StaticFnsMap :-> ?])
(t/ann cljs.analyzer/infer-tag ?)
(t/ann cljs.analyzer/js-reserved (t/Set t/Str))
(t/ann *inputs* nil)
(t/ann *lexical-renames* (t/Map t/Nothing t/Nothing))
(t/ann *recompiled* nil)
(t/ann *source-map-data* nil)
(t/ann array-map-threshold t/Int)
(t/ann base-types (t/Set t/Str))
(t/ann build-affecting-options AnyFunction)
(t/ann cached-core AnyFunction)
(t/ann checking-types? [:-> nil])
(t/ann cljs-files-in AnyFunction)
(t/ann cljs-reserved-file-names (t/Set t/Str))
(t/ann comma-sep ['[op] :-> (t/Coll op)])
(t/ann compile-file AnyFunction)
(t/ann compile-file* AnyFunction)
(t/ann compile-root AnyFunction)
(t/ann compiled-by-string AnyFunction)
(t/ann distinct-constants? AnyFunction)
(t/ann distinct-keys? AnyFunction)
(t/ann emit [op :-> nil])
(t/ann emit* clojure.lang.MultiFn)
(t/ann emit-apply-to AnyFunction)
(t/ann emit-arguments-to-array AnyFunction)
(t/ann emit-cached-core AnyFunction)
(t/ann
emit-comment
(t/IFn
[(t/U nil context) t/Str (t/U nil (t/Coll nil)) :-> nil]
[t/Str nil :-> nil]))
(t/ann emit-constant clojure.lang.MultiFn)
(t/ann emit-constants-table AnyFunction)
(t/ann emit-constants-table-to-file AnyFunction)
(t/ann emit-externs AnyFunction)
(t/ann emit-fn-method [EnvExprFormMap :-> nil])
(t/ann emit-fn-params [(t/Vec op) :-> nil])
(t/ann emit-inferred-externs-to-file AnyFunction)
(t/ann emit-let AnyFunction)
(t/ann emit-source AnyFunction)
(t/ann emit-source-map AnyFunction)
(t/ann emit-str AnyFunction)
(t/ann emit-variadic-fn-method AnyFunction)
(t/ann emitln (t/IFn [t/Str t/Str :-> nil] [t/Str :-> nil]))
(t/ann
emits
(t/IFn
[t/Str t/Any :-> nil]
[t/Any :-> nil]
[? ? ? ? :-> nil]
[? ? ? ? ? nil :-> nil]
[:-> nil]
[? ? ? :-> nil]))
(t/ann emits-keyword AnyFunction)
(t/ann emits-symbol AnyFunction)
(t/ann escape-char AnyFunction)
(t/ann escape-string [t/Str :-> t/Str])
(t/ann falsey-constant? AnyFunction)
(t/ann find-root-sources AnyFunction)
(t/ann find-source AnyFunction)
(t/ann fn-self-name [name-info__899853 :-> t/Sym])
(t/ann get-define [t/Sym nil :-> nil])
(t/ann
hash-scope
[(t/U name-info__899853 ColumnLineNameMap op) :-> t/Int])
(t/ann js-reserved (t/Set t/Str))
(t/ann load-libs AnyFunction)
(t/ann macro-ns? AnyFunction)
(t/ann mapped-types (t/Map t/Str t/Str))
(t/ann
munge
(t/IFn
[t/Any (t/Set t/Str) :-> (t/U t/Str t/Sym)]
[t/Any :-> (t/U t/Str t/Sym)]))
(t/ann munge-param-return AnyFunction)
(t/ann munge-reserved [(t/Set t/Str) :-> [t/Str :-> t/Str]])
(t/ann ns-first-segments [:-> (t/Coll t/Str)])
(t/ann protocol-prefix AnyFunction)
(t/ann rename-to-js AnyFunction)
(t/ann requires-compilation? AnyFunction)
(t/ann resolve-type AnyFunction)
(t/ann resolve-types AnyFunction)
(t/ann safe-test? AnyFunction)
(t/ann
shadow-depth
[(t/U
name-info__899853
ColumnLineNameMap
op
FnVarMethodParamsNameMap)
:->
t/Int])
(t/ann truthy-constant? AnyFunction)
(t/ann url-path AnyFunction)
(t/ann valid-define-value? AnyFunction)
(t/ann with-core-cljs [StaticFnsMap AnyFunction :-> ?])
(t/ann wrap-in-double-quotes [t/Str :-> t/Str])
(t/ann cljs.env/*compiler* nil)
(t/ann cljs.env/default-compiler-env ?)
;; End: Generated by clojure.core.typed - DO NOT EDIT
#?(:clj (set! *warn-on-reflection* true))
(def js-reserved ana/js-reserved)
@@ -53,7 +340,7 @@
; Helper fn
(defn shadow-depth [s]
(let [{:keys [name info]} s]
(loop [d 0, {:keys [shadow]} info]
(loop [^{::t/ann t/Int} ^{::t/ann t/Int} d 0, ^{::t/ann (t/U nil NameArglistsArglistsMetaMap)} ^{::t/ann (t/U nil name-info__899853)} {:keys [shadow]} info]
(cond
shadow (recur (inc d) shadow)
(some #{(str name)} (ns-first-segments)) (inc d)
@@ -77,10 +364,13 @@
(str (string/replace (str ns) "." "$") "$" scoped-name)))))
(defn munge-reserved [reserved]
(fn [s]
(if-not (nil? (get reserved s))
(str s "$")
s)))
(t/ann-form
(fn [s]
(if-not (nil? (get reserved s))
(str s "$")
s))
[t/Str :-> t/Str])
)
(defn munge
([s] (munge s js-reserved))