<< Back to previous view

[CTYP-64] Improvements to Error Messsages Created: 20/Sep/13  Updated: 09/Oct/13  Resolved: 25/Sep/13

Status: Closed
Project: core.typed
Component/s: None
Affects Version/s: 0.2.0
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Julian Birch Assignee: Ambrose Bonnaire-Sergeant
Resolution: Completed Votes: 0
Labels: None


 Description   

These are a bunch of "if you do stupid things, it doesn't help"

1) If you do ann-datatype on a record, error message is incomprehensible.
2) ```clj
(ann-protocol IValidator
validate- [Term Any])
```
crashes and doesn't explain what's wrong with the syntax.
3) So does
(ann-protocol IValidator
validate- [[Term Any] -> Any])



 Comments   
Comment by Ambrose Bonnaire-Sergeant [ 21/Sep/13 12:47 PM ]

The error message for ann-datatype'ing a record should be much clearer in 0.2.9. Please verify.

Comment by Julian Birch [ 22/Sep/13 9:42 AM ]

(ann-datatype X [x :- Number])
(defrecord X [x])

gives

5: Reference to untyped binding: __meta
Hint: Add the annotation for __meta via check-ns or cf

which still seems pretty confusing. Sorry if I'm doing something wrong here.

Comment by Ambrose Bonnaire-Sergeant [ 23/Sep/13 3:46 AM ]

Yes, I fixed the wrong bug.

Comment by Ambrose Bonnaire-Sergeant [ 23/Sep/13 10:57 AM ]

Should really be fixed in 0.2.10

Comment by Ambrose Bonnaire-Sergeant [ 25/Sep/13 3:29 AM ]

Fixed in master:

Addressing point 2:

(cf (ann-protocol IValidator
                  validate- [Term Any]))
ExceptionInfo Internal Error (clojure.core.typed.test.core:1:34) Incorrect function syntax: [Term Any]  clojure.core/ex-info (core.clj:4327)

Point 3:

(cf (ann-protocol IValidator
                  validate- [[Term Any] -> Any]))
ExceptionInfo Internal Error (clojure.core.typed.test.core:1:34) Incorrect function syntax: [Term Any]  clojure.core/ex-info (core.clj:4327)
Generated at Thu Aug 21 21:06:28 CDT 2014 using JIRA 4.4#649-r158309.