tools.nrepl

Pretty-printing reference returned by clojure.tools.nrepl.server/start-server causes multimethod exception

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: 0.2.3
  • Fix Version/s: 0.2.4
  • Component/s: None
  • Labels:

Description

I was accidentally printing the reference returned by start-server by calling it as the final function in my main method, which causes this error:

java.lang.IllegalArgumentException: Multiple methods in multimethod 'print-method' match dispatch value: class clojure.tools.nrepl.server.Server -> interface clojure.lang.IDeref and interface clojure.lang.IRecord, and neither is preferred
at clojure.lang.MultiFn.findAndCacheBestMethod(MultiFn.java:136)
at clojure.lang.MultiFn.getMethod(MultiFn.java:111)
at clojure.lang.MultiFn.getFn(MultiFn.java:119)
at clojure.lang.MultiFn.invoke(MultiFn.java:167)
at clojure.core$pr_on.invoke(core.clj:3266)
at clojure.core$pr.invoke(core.clj:3278)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:601)
at clojure.core$prn.doInvoke(core.clj:3311)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.main$eval_opt.invoke(main.clj:299)
at clojure.main$initialize.invoke(main.clj:316)
at clojure.main$null_opt.invoke(main.clj:349)
at clojure.main$main.doInvoke(main.clj:427)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:419)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.main.main(main.java:37)

Activity

Hide
Chas Emerick added a comment -

Committed, will be available in 0.2.4-SNAPSHOT momentarily.

Show
Chas Emerick added a comment - Committed, will be available in 0.2.4-SNAPSHOT momentarily.
Hide
Chas Emerick added a comment -

Thanks, should have thought of this when I fixed the related issue.

Show
Chas Emerick added a comment - Thanks, should have thought of this when I fixed the related issue.
Hide
Michael Nygard added a comment -

I cloned this from NREPL-37, but cannot change any of the other fields. Thanks Jira.

Basically, this is the same dispatch problem as NREPL-37 but on clojure.pprint/simple-dispatch.

Version affected is 0.2.3.

Show
Michael Nygard added a comment - I cloned this from NREPL-37, but cannot change any of the other fields. Thanks Jira. Basically, this is the same dispatch problem as NREPL-37 but on clojure.pprint/simple-dispatch. Version affected is 0.2.3.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: