core.typed

Improvements to Error Messsages

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: 0.2.0
  • Fix Version/s: None
  • Component/s: None
  • 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])

Activity

Hide
Ambrose Bonnaire-Sergeant added a comment -

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

Show
Ambrose Bonnaire-Sergeant added a comment - The error message for ann-datatype'ing a record should be much clearer in 0.2.9. Please verify.
Hide
Julian Birch added a comment -

(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.

Show
Julian Birch added a comment - (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.
Hide
Ambrose Bonnaire-Sergeant added a comment -

Yes, I fixed the wrong bug.

Show
Ambrose Bonnaire-Sergeant added a comment - Yes, I fixed the wrong bug.
Hide
Ambrose Bonnaire-Sergeant added a comment -

Should really be fixed in 0.2.10

Show
Ambrose Bonnaire-Sergeant added a comment - Should really be fixed in 0.2.10
Hide
Ambrose Bonnaire-Sergeant added a comment - - edited

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)
Show
Ambrose Bonnaire-Sergeant added a comment - - edited 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)
Ambrose Bonnaire-Sergeant made changes -
Field Original Value New Value
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Ambrose Bonnaire-Sergeant made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: