File tree
Expand file treeCollapse file tree4 files changed
+32
-1
lines changed Expand file treeCollapse file tree4 files changed
+32
-1
lines changed Original file line number | Diff line number | Diff line change |
---|
|
1361 | 1361 | [env t]
|
1362 | 1362 | ;; don't use resolve-existing-var to avoid warnings
|
1363 | 1363 | (when (and (some? t) (symbol? t))
|
1364 |
| -(let [var (resolve-var env t)] |
| 1364 | +(let [var (binding [*private-var-access-nowarn* true] |
| 1365 | +(resolve-var env t))] |
1365 | 1366 | (if-some [type (:type var)]
|
1366 | 1367 | type
|
1367 | 1368 | (if-some [type (-> var :info :type)]
|
|
Original file line number | Diff line number | Diff line change |
---|
|
| 1 | +(ns cljs-3284.bean) |
| 2 | + |
| 3 | +(deftype ^:private SomeType [a]) |
| 4 | + |
| 5 | +(defn some-type |
| 6 | +[a] |
| 7 | +(SomeType. a)) |
Original file line number | Diff line number | Diff line change |
---|
|
| 1 | +(ns cljs-3284.core |
| 2 | +(:require |
| 3 | +cljs-3284.bean)) |
| 4 | + |
| 5 | +(defn maybe-bean |
| 6 | +[x] |
| 7 | +(if (object? x) |
| 8 | +(cljs-3284.bean/some-type x) |
| 9 | +x)) |
Original file line number | Diff line number | Diff line change |
---|
|
768 | 768 | (is (empty? @ws))))
|
769 | 769 | (.delete (io/file "package.json"))
|
770 | 770 | (test/delete-node-modules))
|
| 771 | + |
| 772 | +(deftest test-cljs-3284 |
| 773 | +(testing "Type hint warnings don't fire just because of private types" |
| 774 | +(let [ws (atom []) |
| 775 | +out (.getPath (io/file (test/tmp-dir) "cljs-3235-out")) |
| 776 | +{:keys [inputs opts]} {:inputs (str (io/file "src" "test" "cljs_build")) |
| 777 | +:opts {:main 'cljs-3284.core |
| 778 | +:output-dir out |
| 779 | +:optimizations :none}} |
| 780 | +cenv (env/default-compiler-env opts)] |
| 781 | +(test/delete-out-files out) |
| 782 | +(ana/with-warning-handlers [(collecting-warning-handler ws)] |
| 783 | +(build/build (build/inputs (io/file inputs "cljs_3284/core.cljs")) opts cenv)) |
| 784 | +(is (empty? @ws))))) |
You can’t perform that action at this time.
0 commit comments