Skip to content

Commit d0c35bb

Browse files
Merge pull request #69 from bevuta/fix-68
Drop type-hints from `assoc-conversion` to work around AOT issue
2 parents 0dff201 + 12ac261 commit d0c35bb

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

project.clj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
:default (complement :stress)}
2121
:plugins [[jonase/eastwood "1.3.0"]
2222
[lein-cljfmt "0.9.0"]]
23+
:eastwood {:ignored-faults {:reflection {clj-commons.byte-streams.graph [{:line 121}
24+
{:line 122}
25+
{:line 123}
26+
{:line 124}]
27+
byte-streams.graph [{:line 126}
28+
{:line 127}
29+
{:line 128}
30+
{:line 129}]}}}
2331
:global-vars {*warn-on-reflection* true}
2432
:java-source-paths ["src"]
2533
:javac-options ["-target" "1.8" "-source" "1.8"]

src/byte_streams/graph.clj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,15 @@
118118
IConversionGraph
119119
(assoc-conversion [_ src dst f cost]
120120
(let [m' (assoc-in m [src dst] (Conversion. f cost))
121+
;; NOTE: These method calls are
122+
;; intentionally done without type-hints to
123+
;; work around
124+
;; https://github.com/clj-commons/byte-streams/issues/68
121125
m' (if (and
122-
(nil? (.wrapper ^Type src))
123-
(nil? (.wrapper ^Type dst)))
124-
(let [src (.type ^Type src)
125-
dst (.type ^Type dst)]
126+
(nil? (.wrapper src))
127+
(nil? (.wrapper dst)))
128+
(let [src (.type src)
129+
dst (.type dst)]
126130
(-> m'
127131
(assoc-in [(Type. 'seq src) (Type. 'seq dst)]
128132
(Conversion. (fn [x options] (map #(f % options) x)) cost))

src/clj_commons/byte_streams/graph.clj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,15 @@
113113
IConversionGraph
114114
(assoc-conversion [_ src dst f cost]
115115
(let [m' (assoc-in m [src dst] (Conversion. f cost))
116+
;; NOTE: These method calls are
117+
;; intentionally done without type-hints to
118+
;; work around
119+
;; https://github.com/clj-commons/byte-streams/issues/68
116120
m' (if (and
117-
(nil? (.wrapper ^Type src))
118-
(nil? (.wrapper ^Type dst)))
119-
(let [src (.type ^Type src)
120-
dst (.type ^Type dst)]
121+
(nil? (.wrapper src))
122+
(nil? (.wrapper dst)))
123+
(let [src (.type src)
124+
dst (.type dst)]
121125
(-> m'
122126
(assoc-in [(Type. 'seq src) (Type. 'seq dst)]
123127
(Conversion. (fn [x options] (map #(f % options) x)) cost))

0 commit comments

Comments
 (0)