Clojure

better error messages for bad defrecord calls

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Approval:
    Triaged

Description

defrecord could tell you if, e.g., you didn't specify an interface before leaping into method bodies.

(defrecord TestRecord [afield bfield cfield] 
  (printc [_] (println cfield)))
ClassCastException clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol  clojure.core/ns-resolve (core.clj:4238)

See http://groups.google.com/group/clojure/browse_thread/thread/f52f90954edd8b09

Activity

Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - Converted from http://www.assembla.com/spaces/clojure/tickets/405
Hide
Assembla Importer added a comment -

stu said: This could be fixed with an assert-valid-defrecord call in core_deftype, similar to assert-valid-fdecl in core.clj. Such a function would also be a place to hang other defrecord error messages.

Show
Assembla Importer added a comment - stu said: This could be fixed with an assert-valid-defrecord call in core_deftype, similar to assert-valid-fdecl in core.clj. Such a function would also be a place to hang other defrecord error messages.
Alex Miller made changes -
Field Original Value New Value
Fix Version/s Backlog [ 10035 ]
Alex Miller made changes -
Priority Major [ 3 ]
Alex Miller made changes -
Labels defrecord errormsgs
Alex Miller made changes -
Reporter Assembla Importer [ importer ]
Description defrecord could tell you if, e.g., you didn't specify an interface before leaping into method bodies. See http://groups.google.com/group/clojure/browse_thread/thread/f52f90954edd8b09 defrecord could tell you if, e.g., you didn't specify an interface before leaping into method bodies.

{code}
(defrecord TestRecord [afield bfield cfield]
  (printc [_] (println cfield)))
ClassCastException clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol clojure.core/ns-resolve (core.clj:4238)
{code}

See http://groups.google.com/group/clojure/browse_thread/thread/f52f90954edd8b09
Approval Triaged [ 10120 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: