Last active
January 2, 2016 10:29
-
-
Save wagjo/8290237 to your computer and use it in GitHub Desktop.
Bug in nrepl?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; AOT before loading (e.g. with :aot :all in project.clj) | |
;; $ lein deps :tree | |
;; [clojure-complete "0.2.3" :exclusions [[org.clojure/clojure]]] | |
;; [org.clojure/clojure "1.5.1"] | |
;; [org.clojure/tools.nrepl "0.2.3" :exclusions [[org.clojure/clojure]]] | |
(ns ccc.core | |
(:gen-class)) | |
(defprotocol P) | |
(assert (identical? (:on-interface P) ccc.core.P)) | |
;; protocol definition inside a function | |
;; used e.g. in clojure.core.typed/defprotocol> | |
(identity (defprotocol P2)) | |
(defn -main | |
[& args] | |
;; using nrepl, following bug appears | |
;; false false true false | |
(println (identical? (:on-interface P2) ccc.core.P2) | |
(satisfies? P2 (reify P2)) | |
(instance? ccc.core.P2 (reify P2)) | |
(instance? (:on-interface P2) (reify P2))) | |
;; workaround | |
(alter-var-root #'P2 assoc :on-interface ccc.core.P2) | |
;; true true true true | |
(println (identical? (:on-interface P2) ccc.core.P2) | |
(satisfies? P2 (reify P2)) | |
(instance? ccc.core.P2 (reify P2)) | |
(instance? (:on-interface P2) (reify P2))) | |
(println "DONE")) | |
(comment | |
;; eval in emacs to produce bug, e.g. C-c C-k, C-x C-e | |
(-main) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment