Clojure

Deref throws an unhelpful error message when used on something not dereferencable

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Patch:
    Code and Test
  • Approval:
    Triaged

Description

Consider the following code:

(def x 1)
(def y (ref 2))

(+ @x y)

Clojure throws a ClassCastException on cast to Future. This is a very unhelpful error message; why a Future, why not Ref, Atom etc. It would be nice if this failed more gracefully.

  1. deref.patch
    15/Sep/14 2:08 PM
    2 kB
    Tobias Kortkamp
  2. tests-patch.diff
    17/Sep/14 5:44 AM
    1.0 kB
    Mark Nutter

Activity

People

Vote (3)
Watch (1)

Dates

  • Created:
    Updated: