Skip to content

Instantly share code, notes, and snippets.

@mk
Created January 17, 2023 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mk/d8f60f0b13bf6a63c6afc89d6f7e7565 to your computer and use it in GitHub Desktop.
Save mk/d8f60f0b13bf6a63c6afc89d6f7e7565 to your computer and use it in GitHub Desktop.
tools.analyzer hashCode change
{:paths ["."]
:deps {org.clojure/tools.analyzer {:mvn/version "1.1.0"}
org.clojure/tools.analyzer.jvm {:mvn/version "1.1.0"}}}
$ clj -M repro.clj
:hash-code/before 308316550
:hash-code/after 1108589630
(ns repro
(:require [clojure.tools.analyzer.jvm :as ana-jvm]))
(defrecord MyRecord [form])
(prn :hash-code/before (.hashCode MyRecord))
(do
(let [form '(defrecord MyRecord [form])]
(ana-jvm/analyze form (ana-jvm/empty-env) {}))
:analyzed)
(prn :hash-code/after (.hashCode MyRecord))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment