[CTYP-91] polymorphic ann-protocol doesn't work Created: 30/Oct/13 Updated: 05/Nov/13 Resolved: 05/Nov/13
|Reporter:||Russell Mull||Assignee:||Ambrose Bonnaire-Sergeant|
Clojure 1.5.1, Core.typed 0.2.14 and 0.2.15
The example of a polymorphic defprotocol annotation from the documentation is:
It's implied that there exists a corresponding protocol like this:
Type checking this code with check-ns gives an error:
Incidentally, it would be nice if the example in the documentation actually used the declared type parameter in some way.
|Comment by Russell Mull [ 30/Oct/13 10:01 PM ]|
The above stack trace is from 0.2.14. This is the trace for 0.2.15:
|Comment by Ambrose Bonnaire-Sergeant [ 05/Nov/13 9:52 AM ]|
This exposes that polymorphic protocols are completely untested :/
This issue is fixed in 0.2.16: https://github.com/clojure/core.typed/commit/4474f76eea1e966523914c5455761f1e7b8542c8
Also updated the doc: https://github.com/clojure/core.typed/commit/216454c8c292d68dfa1ac1cd5ce36e00f43cc1c8
This doesn't mean polymorphic protocols/datatypes are usable yet, but it's progress. Working on it.