File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed
Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 933933 ; ; ignore new type hints for now - David
934934 (and (not (set? tag))
935935 (not ('#{any clj clj-or-nil clj-nil number string boolean function object array} tag))
936- (when-let [ps (:protocols (ana/resolve-existing-var ( dissoc env :locals ) tag))]
936+ (when-let [ps (:protocols (ana/resolve-existing-var env ( symbol ( name tag)) ))]
937937 (ps protocol)))))))
938938 opt-not? (and (= (:name info) 'cljs.core/not)
939939 (= (ana/infer-tag env (first (:args expr))) 'boolean))
Original file line number Diff line number Diff line change 147147 `(cljs.user/foo ~(tags/->JSValue []))
148148 '(cljs.user/foo (make-array 0 ))))))
149149
150+ ; ; CLJS-1607
151+
152+ (deftest test-cljs-1607
153+ (let [define-Foo #(assoc-in % [::ana/namespaces 'cljs.user :defs 'Foo]
154+ {:ns 'cljs.user
155+ :name 'cljs.user/Foo
156+ :protocol-symbol true
157+ :protocol-info {:methods '{foo [[this]]}}
158+ :protocol 'cljs.user/Foo})
159+ define-foo #(assoc-in % [::ana/namespaces 'cljs.user :defs 'foo]
160+ {:ns 'cljs.user
161+ :name 'cljs.user/foo
162+ :fn-var true
163+ :method-params '([x])
164+ :protocol 'cljs.user/Foo})
165+ aenv-with-foo (-> aenv define-foo define-Foo)
166+ cenv-with-foo (-> @cenv define-foo define-Foo)]
167+ (binding [ana/*cljs-static-fns* true ]
168+ (are [form]
169+ (empty?
170+ (capture-warnings
171+ (env/with-compiler-env (atom cenv-with-foo)
172+ (with-out-str
173+ (comp/emit
174+ (ana/analyze aenv-with-foo form))))))
175+ '(specify! []
176+ cljs.user/Foo
177+ (cljs.user/foo [this]
178+ :none )
179+ Object
180+ (bar [this]
181+ (cljs.user/foo this)))))))
182+
150183; ; CLJS-1225
151184
152185(comment
You can’t perform that action at this time.
0 commit comments