Skip to content

Instantly share code, notes, and snippets.

@zilti
Last active August 29, 2015 14:02
Show Gist options
  • Save zilti/ac127170605600d008bb to your computer and use it in GitHub Desktop.
Save zilti/ac127170605600d008bb to your computer and use it in GitHub Desktop.
core.typed fails to properly load protocols
(ns broken-protocol.core
(:refer-clojure :exclude [doseq let fn dotimes defprotocol loop for])
(:require [clojure.core.typed :refer :all]
broken-protocol.other))
(ns broken-protocol.core
(:refer-clojure :exclude [doseq let fn dotimes defprotocol loop for])
(:require [clojure.core.typed :refer :all]))
(ann-protocol Initializable
initialize [Any -> Nothing])
(defprotocol> Initializable
(initialize [this]))
(defproject broken-protocol "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[org.clojure/core.typed "0.2.51"]]
:plugins [[lein-typed "0.3.4"]]
:core.typed {:check [broken-protocol.core broken-protocol.other]})
Initializing core.typed ...
Building core.typed base environments ...
Finished building base environments
"Elapsed time: 4453.814043 msecs"
core.typed initialized.
Start collecting broken-protocol.core
Start collecting broken-protocol.other
Finished collecting broken-protocol.other
Finished collecting broken-protocol.core
Collected 2 namespaces in 4806.79317 msecs
Start checking broken-protocol.core
DEPRECATED SYNTAX (broken_protocol/core.clj): Any syntax is deprecated, use clojure.core.typed/Any
Checked broken-protocol.core in 432.452678 msecs
Checked 1 namespaces (approx. 5 lines) in 5242.339524 msecs
Start collecting broken-protocol.other
Exception in thread "main" java.lang.LinkageError: loader (instance of clojure/lang/DynamicClassLoader): attempted duplicate class definition for name: "broken_protocol/core/Initializable", compiling:(/tmp/form-init7476160765735569246.clj:1:90)
at clojure.lang.Compiler.load(Compiler.java:7142)
at clojure.lang.Compiler.loadFile(Compiler.java:7086)
at clojure.main$load_script.invoke(main.clj:274)
at clojure.main$init_opt.invoke(main.clj:279)
at clojure.main$initialize.invoke(main.clj:307)
at clojure.main$null_opt.invoke(main.clj:342)
at clojure.main$main.doInvoke(main.clj:420)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:383)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: java.lang.LinkageError: loader (instance of clojure/lang/DynamicClassLoader): attempted duplicate class definition for name: "broken_protocol/core/Initializable"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
at clojure.lang.DynamicClassLoader.defineClass(DynamicClassLoader.java:46)
at clojure.core$gen_interface.doInvoke(genclass.clj:723)
at clojure.lang.RestFn.invoke(RestFn.java:521)
at clojure.lang.Var.invoke(Var.java:409)
at clojure.lang.AFn.applyToHelper(AFn.java:178)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.core$apply.invoke(core.clj:628)
at clojure.tools.analyzer.jvm$macroexpand_1.invoke(jvm.clj:154)
at clojure.tools.analyzer$macroexpand.invoke(analyzer.clj:206)
at clojure.tools.analyzer.jvm$analyze_PLUS_eval$fn__12989.invoke(jvm.clj:480)
at clojure.tools.analyzer.jvm$analyze_PLUS_eval.invoke(jvm.clj:479)
at clojure.tools.analyzer.jvm$analyze_PLUS_eval.invoke(jvm.clj:477)
at clojure.tools.analyzer.jvm$analyze_PLUS_eval$fn__12998.invoke(jvm.clj:487)
at clojure.core$mapv$fn__6311.invoke(core.clj:6353)
at clojure.lang.ArrayChunk.reduce(ArrayChunk.java:63)
at clojure.core.protocols$fn__6093.invoke(protocols.clj:98)
at clojure.core.protocols$fn__6057$G__6052__6066.invoke(protocols.clj:19)
at clojure.core.protocols$seq_reduce.invoke(protocols.clj:31)
at clojure.core.protocols$fn__6076.invoke(protocols.clj:60)
at clojure.core.protocols$fn__6031$G__6026__6044.invoke(protocols.clj:13)
at clojure.core$reduce.invoke(core.clj:6289)
at clojure.core$mapv.invoke(core.clj:6353)
at clojure.tools.analyzer.jvm$analyze_PLUS_eval.invoke(jvm.clj:487)
at clojure.tools.analyzer.jvm$analyze_PLUS_eval.invoke(jvm.clj:488)
at clojure.core.typed.analyze_clj$analyze1.invoke(analyze_clj.clj:105)
at clojure.core.typed.analyze_clj$ast_for_file$fn__13441.invoke(analyze_clj.clj:143)
at clojure.core.typed.analyze_clj$ast_for_file.invoke(analyze_clj.clj:138)
at clojure.core.typed.analyze_clj$ast_for_ns.invoke(analyze_clj.clj:167)
at clojure.core.typed.collect_phase$collect_ns.invoke(collect_phase.clj:92)
at clojure.core.typed$check_ns_info$do_collect__1514.invoke(typed.clj:2324)
at clojure.core.typed$check_ns_info$do_check_ns__1563.invoke(typed.clj:2358)
at clojure.core.typed$check_ns_info.doInvoke(typed.clj:2369)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:626)
at clojure.core.typed$check_ns.doInvoke(typed.clj:2420)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at user$eval48$iter__49__53$fn__54$fn__55$fn__56.invoke(form-init7476160765735569246.clj:1)
at user$eval48$iter__49__53$fn__54$fn__55.invoke(form-init7476160765735569246.clj:1)
at user$eval48$iter__49__53$fn__54.invoke(form-init7476160765735569246.clj:1)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:484)
at clojure.core$seq.invoke(core.clj:133)
at clojure.core$dorun.invoke(core.clj:2855)
at clojure.core$doall.invoke(core.clj:2871)
at user$eval48.invoke(form-init7476160765735569246.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6703)
at clojure.lang.Compiler.eval(Compiler.java:6693)
at clojure.lang.Compiler.load(Compiler.java:7130)
... 11 more
Subprocess failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment