deftype generates new types when evaluation is expected to be suppressed

Description

There does not seem to be a consistent way to prevent deftype from emitting a new type. This was discovered in ClojureCLR when trying to write a defonce-style macro wrapper for deftype, but it affects ClojureJVM as well. It seems to emit types on analysis, which defies Clojure's evaluation semantics.

The following REPL session highlights expected and unexpected behavior, namely that when false is unable to prevent deftype from emitting a new type into memory. comment seems to work, however.

Environment

macOs 10.12.6

Assignee

Unassigned

Reporter

Ramsey Nasser

Labels

Approval

None

Patch

None

Affects versions

Priority

Minor
Configure