Skip to content

Commit 98437ff

Browse files
amalloystuarthalloway
authored andcommitted
Fix CLJ-1202.
Emit forms like (. foo (bar)) instead of (. foo bar), so that names starting with a - don't look like field accesses. Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
1 parent d6b6bb6 commit 98437ff

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/clj/clojure/core_deftype.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@
554554
(let [gargs (map #(gensym (str "gf__" % "__")) args)
555555
target (first gargs)]
556556
`([~@gargs]
557-
(. ~(with-meta target {:tag on-interface}) ~(or on-method method) ~@(rest gargs)))))
557+
(. ~(with-meta target {:tag on-interface}) (~(or on-method method) ~@(rest gargs))))))
558558
arglists))
559559
^clojure.lang.AFunction f#
560560
(fn ~gthis

test/clojure/test_clojure/protocols.clj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,3 +607,12 @@
607607
(is (= :foo (sqtp :foo))))
608608

609609

610+
(defprotocol Dasherizer
611+
(-do-dashed [this]))
612+
(deftype Dashed []
613+
Dasherizer
614+
(-do-dashed [this] 10))
615+
616+
(deftest test-leading-dashes
617+
(is (= 10 (-do-dashed (Dashed.))))
618+
(is (= [10] (map -do-dashed [(Dashed.)]))))

0 commit comments

Comments
 (0)